Player SetFacing menu

User Tag List

Results 1 to 8 of 8
  1. #1
    saimoth's Avatar Member
    Reputation
    1
    Join Date
    Oct 2013
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Player SetFacing

    Gents,

    Have been successful with progressing several bots but have never found a successful way of setting my players rotation. Is there a way of using SetFacing(), or another method, to directly set my characters rotation so that it is also updated server side?

    As an example. Say I’m facing away from an enemy, can I set my rotation so that the server has updated my new rotation angle and allows me to cast without saying I am facing the wrong way? This is the only issue I have always struggled with.

    Any suggestions would be much appreciated.

    I write for 1.12, 2.4.3 and 3.3.5 clients.

    Thanks

    Player SetFacing
  2. #2
    ejt's Avatar Contributor
    Reputation
    209
    Join Date
    Mar 2008
    Posts
    166
    Thanks G/R
    3/111
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    What you could do is set a BP on the local players rotation and see what functions modify/read the value.
    Just a thought.

  3. #3
    Saridormi's Avatar Contributor
    Reputation
    306
    Join Date
    Mar 2007
    Posts
    556
    Thanks G/R
    19/16
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I'm aware, there is no "face XYZ and update the server" function. There's a function that will send movement updates to the server if necessary, but I never bothered reversing it far enough to find out what triggers an update.

    Here is how I do SetFacing in 1.12:

    Code:
    /* Movement */
    #define A_Movement_F_SetFacing 0x7c6f30
    #define A_Movement_F_SendMovementUpdate 0x600a30
    
    /* Opcodes */
    #define A_Opcode_MSG_MOVE_SET_FACING 0xda
    
    typedef void (__thiscall *WoWFunc_SetFacing)(uintptr_t thisUnit, float angle);
    typedef void (__thiscall *WoWFunc_SendMovementUpdate)(uintptr_t thisUnit, int currentTick, int opcode, int unk1,
                                                                  int unk2);
    
        void LocalMovement::SetFacing(const float angle)
        {
            const auto local_player = WoWObjectManager::GetLocalPlayer();
            if (local_player == 0)
                return;
    
            WoWPlayer player(local_player);
    
            WoWFunc_SetFacing(A_Movement_F_SetFacing)(player.GetMovementBase(), angle);
            WoWFunc_SendMovementUpdate(A_Movement_F_SendMovementUpdate)(local_player, WoWFunctions::GetCurrentTick(),
                                                                        A_Opcode_MSG_MOVE_SET_FACING, 0x0, 0x0);
        }


  4. Thanks leehun00, lsjaf3297 (2 members gave Thanks to Saridormi for this useful post)
  5. #4
    vegoo's Avatar Contributor
    CoreCoins Purchaser Authenticator enabled
    Reputation
    275
    Join Date
    Dec 2011
    Posts
    708
    Thanks G/R
    10/27
    Trade Feedback
    110 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am doing it this way:
    1. Get player and target cords
    2. Calculate atan2
    3. Write float to player rotation offset

    Also keep in mind rotation in WoW is between 0 and 6.28, so if atan2 result is lower than 0 you have to add 2 * PI to it.
    Last edited by vegoo; 08-12-2018 at 08:42 PM.
    WoW TGC Loot & WoW Items
    Selling EU & US WoW Gold
    Buying EU & US WoW Gold

  6. Thanks Picasopaya (1 members gave Thanks to vegoo for this useful post)
  7. #5
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1584
    Join Date
    May 2010
    Posts
    1,824
    Thanks G/R
    188/531
    Trade Feedback
    16 (100%)
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by vegoo View Post
    3. Write float to player rotation offset
    You still need to call update or move, or the server will not know.

  8. #6
    saimoth's Avatar Member
    Reputation
    1
    Join Date
    Oct 2013
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great, thanks for the response guys! Will try the SendMovementUpdate function. I’m guessing I could skip the SetFacing and just write my rotation to my player offset and then call the SendMovementUpdate. Also, I guess the SendMovementUpdate is thread safe? Called from the main thread?

  9. #7
    vegoo's Avatar Contributor
    CoreCoins Purchaser Authenticator enabled
    Reputation
    275
    Join Date
    Dec 2011
    Posts
    708
    Thanks G/R
    10/27
    Trade Feedback
    110 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    You still need to call update or move, or the server will not know.
    Yea I am using it to move around, don't know how it works if you only set it and then try to cast something without moving.
    Last edited by vegoo; 08-13-2018 at 03:01 AM.
    WoW TGC Loot & WoW Items
    Selling EU & US WoW Gold
    Buying EU & US WoW Gold

  10. #8
    Saridormi's Avatar Contributor
    Reputation
    306
    Join Date
    Mar 2007
    Posts
    556
    Thanks G/R
    19/16
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by vegoo View Post
    don't know how it works if you only set it and then try to cast something without moving.
    It doesn't.


Similar Threads

  1. Scam stupid players for a few gold
    By Matt in forum WoW Scam Prevention
    Replies: 23
    Last Post: 12-16-2006, 11:25 PM
  2. [Exploit] Find out if an opposite faction player is online
    By Matt in forum World of Warcraft Exploits
    Replies: 7
    Last Post: 11-04-2006, 09:22 AM
  3. [Macro] Trick players to think your going a different way..
    By janzi9 in forum World of Warcraft Exploits
    Replies: 40
    Last Post: 08-14-2006, 03:46 PM
  4. Player Killing in Cenarion Hold
    By Matt in forum World of Warcraft Exploits
    Replies: 1
    Last Post: 05-10-2006, 06:05 PM
  5. AQ40 Disconnect lazy players
    By Matt in forum World of Warcraft Exploits
    Replies: 0
    Last Post: 05-02-2006, 01:13 PM
All times are GMT -5. The time now is 06:20 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search