IsEnemy menu

User Tag List

Thread: IsEnemy

Results 1 to 10 of 10
  1. #1
    shadowKD's Avatar Member
    Reputation
    1
    Join Date
    Jul 2017
    Posts
    24
    Thanks G/R
    7/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IsEnemy

    Hello everyone.

    Tell me how can I understand that unit/player is my enemy or friend knowing his guid / baseaddres?

    IsEnemy
  2. #2
    badusername1234's Avatar Active Member
    Reputation
    26
    Join Date
    Apr 2017
    Posts
    47
    Thanks G/R
    18/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ask them nicely?

  3. Thanks Corthezz (1 members gave Thanks to badusername1234 for this useful post)
  4. #3
    CodeBytes's Avatar Member
    Reputation
    14
    Join Date
    Feb 2020
    Posts
    39
    Thanks G/R
    7/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are external (or internal), you can determine that by comparing the unit's faction template with your own. You'll also want to load FactionTemplate.db2 into your application's memory and run some logic against that. If you are internal, just call the appropriate method from World of Warcraft's API.

  5. #4
    shadowKD's Avatar Member
    Reputation
    1
    Join Date
    Jul 2017
    Posts
    24
    Thanks G/R
    7/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much

  6. #5
    Bogie's Avatar Member
    Reputation
    11
    Join Date
    Apr 2020
    Posts
    17
    Thanks G/R
    8/3
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by CodeBytes View Post
    If you are external (or internal), you can determine that by comparing the unit's faction template with your own. You'll also want to load FactionTemplate.db2 into your application's memory and run some logic against that. If you are internal, just call the appropriate method from World of Warcraft's API.
    I think that is not quite enough.

    I tried doing it this way too, but with the effect that my local bot ran straight into grom gol (as alliance) as the faction template based logic didn't identify the guys in there as hostile.

    I've had a quick look at the cmangos source. I haven't had a chance to implement this myself yet, but from what I see it'd be necessary to at least check a) reputation-based status, and b) pvp guard flags.
    (I'm not sure of there's any other "hard coded" bits like "horde is always hostile to alliance" or such. I presume that would be covered by a the reputation in faction.dbc, but I'll need to have a closer look)

  7. #6
    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)
    The function for determining the "enemy" status is very complicated and will take a lot of time and effort to replicate.

    You have to look at the FactionTemplate and reputation as others have mentioned but there is also the special cases as when someone is mind-controlled they can appear to be friendly or hostile depending on who is controlling the character.

    Imagine on Hakkar where the boss mind-controls the person tanking, if you don't take this in account you will scratch you head endlessly looking for bugs.

  8. Thanks charles420 (1 members gave Thanks to ejt for this useful post)
  9. #7
    shadowKD's Avatar Member
    Reputation
    1
    Join Date
    Jul 2017
    Posts
    24
    Thanks G/R
    7/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I catch packets from the server to throw / set traps. How can I identify the trap used by an enemy or friend?

  10. #8
    Geneditor's Avatar Member
    Reputation
    2
    Join Date
    Mar 2020
    Posts
    11
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tip: Just make a whitelist of mobs you want to kill. At a single bot location there usually 3-4 max different mobs that are running around.

  11. #9
    shadowKD's Avatar Member
    Reputation
    1
    Join Date
    Jul 2017
    Posts
    24
    Thanks G/R
    7/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i need against players

  12. #10
    Bogie's Avatar Member
    Reputation
    11
    Join Date
    Apr 2020
    Posts
    17
    Thanks G/R
    8/3
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by shadowKD View Post
    i need against players
    When you say players, do you actually mean only human players (aka non-npcs)?

    If so, maybe I'm missing something here, but you could just compare the races of the other players with your own to determine whether it's horde/alliance.
    Depending on your server type you might want to check if they're pvp flagged too. And potentially if they're mind controlled (I don't remember if MC changes attackability?)
    All of those things would be very easy to figure out, memory offsets for many versions are around here, or should be easy to find via CE
    Last edited by Bogie; 05-02-2020 at 11:56 AM.

  13. Thanks krustx (1 members gave Thanks to Bogie for this useful post)
All times are GMT -5. The time now is 11:40 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