コード例 #1
0
        public void Execute()
        {
            if (!TalkedToAuctioneer)
            {
                if (CurrentAuctioneer.GetDistance(Bot.Player.Position) > 3.2f)
                {
                    Bot.Movement.SetMovementAction(MovementAction.Move, CurrentAuctioneer);
                }
                else
                {
                    Bot.Movement.StopMovement();

                    IWowUnit auctioneer = Bot.Objects.All.OfType <IWowUnit>()
                                          .FirstOrDefault(e => e.IsAuctioneer && e.Position.GetDistance(CurrentAuctioneer) < 1.0f);

                    if (auctioneer != null)
                    {
                        Bot.Wow.FacePosition(Bot.Player.BaseAddress, Bot.Player.Position, auctioneer.Position);
                        Bot.Wow.InteractWithUnit(auctioneer);
                    }

                    TalkedToAuctioneer = true;
                    AuctioneerTalkTime = DateTime.UtcNow + TimeSpan.FromSeconds(Rnd.Next(120, 180));
                }
            }
            else if (!ReturnedToOrigin && AuctioneerTalkTime < DateTime.UtcNow)
            {
                if (CurrentAuctioneer.GetDistance(OriginPosition) > 8.0f)
                {
                    Bot.Movement.SetMovementAction(MovementAction.Move, OriginPosition);
                }
                else
                {
                    Bot.Movement.StopMovement();
                    ReturnedToOrigin = true;
                }
            }
        }
コード例 #2
0
        public void Execute()
        {
            if (!TalkedToAuctioneer)
            {
                if (CurrentAuctioneer.GetDistance(WowInterface.I.ObjectManager.Player.Position) > 3.2f)
                {
                    WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Moving, CurrentAuctioneer);
                }
                else
                {
                    WowInterface.I.MovementEngine.StopMovement();

                    WowUnit auctioneer = WowInterface.I.ObjectManager.WowObjects.OfType <WowUnit>()
                                         .FirstOrDefault(e => e.IsAuctioneer && e.Position.GetDistance(CurrentAuctioneer) < 1.0f);

                    if (auctioneer != null)
                    {
                        WowInterface.I.HookManager.WowFacePosition(WowInterface.I.ObjectManager.Player, auctioneer.Position);
                        WowInterface.I.HookManager.WowUnitRightClick(auctioneer);
                    }

                    TalkedToAuctioneer = true;
                    AuctioneerTalkTime = DateTime.UtcNow + TimeSpan.FromSeconds(Rnd.Next(120, 180));
                }
            }
            else if (!ReturnedToOrigin && AuctioneerTalkTime < DateTime.UtcNow)
            {
                if (CurrentAuctioneer.GetDistance(OriginPosition) > 8.0f)
                {
                    WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Moving, OriginPosition);
                }
                else
                {
                    WowInterface.I.MovementEngine.StopMovement();
                    ReturnedToOrigin = true;
                }
            }
        }