behid the target math/code ? menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    ostapus's Avatar Active Member
    Reputation
    60
    Join Date
    Nov 2008
    Posts
    180
    Thanks G/R
    3/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    behid the target math/code ?

    Anyone will be nice enough to provide code/math to detect if you (player) is behind the target (shred,backstub) ?

    tia

    behid the target math/code ?
  2. #2
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    You can get the direction that the target is facing. Then take the direction you are facing. Take the xyz of both players, do some grade 2 math and you can see if you are behind the target. Not hard really... Or you can look to see if the attack is usable...

  3. #3
    streppel's Avatar Active Member
    Reputation
    78
    Join Date
    Mar 2007
    Posts
    196
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2nd way would be for the lazy people....xD

  4. #4
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Behind the target:

    Object->X = Target->X - HowFarBehind * cos( Target->R )
    Object->Y = Target->Y - HowFarBehind * sin( Target->R )
    Last edited by Master674; 12-27-2011 at 03:30 PM.

  5. #5
    ostapus's Avatar Active Member
    Reputation
    60
    Join Date
    Nov 2008
    Posts
    180
    Thanks G/R
    3/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2nd way (attack is usable) wont work, as it is always usable but you get error on use attempt.
    Master674: this math gives the point/coords behind the target, however this is not exactly what i am looking for
    anyone with good 2 grade math skillz around ?

  6. #6
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ostapus View Post
    2nd way (attack is usable) wont work, as it is always usable but you get error on use attempt.
    Master674: this math gives the point/coords behind the target, however this is not exactly what i am looking for
    anyone with good 2 grade math skillz around ?
    Try and specify why this isn't good enough? The point you get is where you should aim to be at position wise while facing the target and if both conditions are met you can backstab? Not sure what else your reason for doing it different would be?
    “Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.” - Rich Cook

  7. #7
    ostapus's Avatar Active Member
    Reputation
    60
    Join Date
    Nov 2008
    Posts
    180
    Thanks G/R
    3/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    because, you/player dont have to be facing precise to target back, basically there will be threshold where player can be positioned and facing to execute backstab.

  8. #8
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I think if the angle between your position and their facing direction is greater than +90 or less than -90 degrees, you are considered behind.

  9. #9
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    I think if the angle between your position and their facing direction is greater than +90 or less than -90 degrees, you are considered behind.
    Indeed. Basically check if the dot product of the mob direction vector and the mob->player vector is <= 0.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  10. #10
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ostapus View Post
    2nd way (attack is usable) wont work, as it is always usable but you get error on use attempt.
    Master674: this math gives the point/coords behind the target, however this is not exactly what i am looking for
    anyone with good 2 grade math skillz around ?
    Didn't read correctly sorry.

  11. #11
    counted's Avatar Contributor Authenticator enabled
    Reputation
    203
    Join Date
    Mar 2008
    Posts
    183
    Thanks G/R
    11/108
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    This Works for me...

    Code:
    public bool LpIsBehind
            {
                get
                {
                    var bearing = HeadingDeltaTo(Manager.Me.Location);
                    return bearing >= 90 && bearing <= 270;
                }
            }
    
            public float HeadingDeltaTo(CVec3 loc)
            {
                // Pi to -Pi, Zero is facing the Location
                var angle = BearingTo(loc) - HRotation * 180 / (float)Math.PI;
    
                if (angle < 0)
                    //add the maximum possible angle (PI x 2) to normalize the negative angle
                    angle += 360;
                return angle;
            }
    
     public float BearingTo(CVec3 loc)
            {
                //An angle, θ, measured in radians, such that -π ≤ θ ≤ π, and tan(θ) = y / x, where (x, y) is a point in the Cartesian plane. Observe the following: 
                //For (x, y) in quadrant 1, 0 < θ < π/2.
                //For (x, y) in quadrant 2, π/2 < θ ≤ π.
                //For (x, y) in quadrant 3, -π < θ < -π/2.
                //For (x, y) in quadrant 4, -π/2 < θ < 0.
    
                //For points on the boundaries of the quadrants, the return value is the following:
                //If y is 0 and x is not negative, θ = 0.
                //If y is 0 and x is negative, θ = π.
                //If y is positive and x is 0, θ = π/2.
                //If y is negative and x is 0, θ = -π/2.
    
                var angle = (float)Math.Atan2(loc.Y - Location.Y, loc.X - Location.X);
    
                if (angle < 0)
                    //add the maximum possible angle (PI x 2) to normalize the negative angle
                    angle += (float)(Math.PI * 2);
    
                return angle * 180 / (float)Math.PI;
    
            }

  12. #12
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    I think if the angle between your position and their facing direction is greater than +90 or less than -90 degrees, you are considered behind.
    Generally yes. But then there's special cases like Ragnaros in Firelands, who has a 120 degree back. Or the tentacles in the Deathwing encounter(s), which can be backstabbed from any direction, etc.
    Although I have no idea if this is also stored in the client or if it's strictly a server side check.

  13. #13
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by _Mike View Post
    Generally yes. But then there's special cases like Ragnaros in Firelands, who has a 120 degree back. Or the tentacles in the Deathwing encounter(s), which can be backstabbed from any direction, etc.
    Although I have no idea if this is also stored in the client or if it's strictly a server side check.
    Serverside,

    try playing a 'backstab' style class with some lag, it's hell.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  14. #14
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    It would have to be at least serverside (though possibly client side as well for UI purposes, etc). Otherwise it would be fairly trivial to write a "backstab hack" to allow you to backstab from the front. Incidentally, I wonder if someone could combine a teleport hack to allow you to do this? Teleport behind, backstab, teleport back, all in one packet?

  15. #15
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    It would have to be at least serverside (though possibly client side as well for UI purposes, etc). Otherwise it would be fairly trivial to write a "backstab hack" to allow you to backstab from the front. Incidentally, I wonder if someone could combine a teleport hack to allow you to do this? Teleport behind, backstab, teleport back, all in one packet?
    It's not possible to do this in a single packet as spellcast packets do not have a movement info block. Those who have access to an instant teleporter should definatly try this out!

    I can think of quite a few things that may go wrong though, the results may be... unstable.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

Page 1 of 2 12 LastLast

Similar Threads

  1. [Lua] Mobs always cast spells on themselves. Not the target
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 08-17-2009, 09:12 AM
  2. "Spell_to_sql" folder in the ArcEmu source code ?
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 01-13-2009, 06:13 PM
  3. Is there anyway to get the targets armor
    By Dearleader in forum WoW Memory Editing
    Replies: 14
    Last Post: 01-07-2009, 12:12 PM
  4. [New] The Target-Tracker Program
    By blubb12345 in forum World of Warcraft Bots and Programs
    Replies: 51
    Last Post: 09-07-2008, 10:51 PM
All times are GMT -5. The time now is 06:22 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search