Unit Flags and Unit Reaction menu

User Tag List

Results 1 to 12 of 12
  1. #1
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unit Flags and Unit Reaction

    I'm currently struggling around with some unit flags I need to know.

    I did a research on the flags which indicate wether you are in combat or not, but it seems not to work.

    Code:
        public bool inCombat
         {
                get
                {
                    return  Convert.ToBoolean(flags & 0x0080000);
                }
           }
    Whereas the "isLootable" property correcly works.

    Code:
       public bool isLootable
            {
                get
                {
                    if (dynamicFlags == 13 || dynamicFlags == 1)
                        return true;
                    return false;             
                }
            }
    I checked the memory read on the unit decriptor array, and it seems to retrieve the values correctly.

    Unit Flags and Unit Reaction
  2. #2
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since I'm nitpicky about .NET code standards, here's a fixed version...

    P.S; Avoid Convert.ToBoolean if you can.

    Code:
        public bool inCombat
         {
                get
                {
                    return  (flags & 0x0080000) == 0;
                }
           }
    Code:
       public bool isLootable
            {
                get
                {
                    return dynamicFlags == 13 || dynamicFlags == 1;          
                }
            }

  3. #3
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2^19 should be right though if I remember correctly. Where do you get your flags from? ( Didn't test it after 3.0.9 )

  4. #4
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the correction Apoc, I wasn't sure if the bitwise AND was correct so I simply used the Conversion class.

    @SKU
    flags equals the "UNIT_DYNAMIC_FLAGS" field
    I'm sure that the flags value is read correctly from memory, my UnitStructure is also up to date.

    So I'm really wondering why isInCombat returns always false.

  5. #5
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm quite sure you get the combat flag from UNIT_FIELD_FLAGS

  6. #6
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah sorry sku, was a typo on my side "UNIT_FIELD_FLAGS" copied the wrong field from my program...

    But "UNIT_FIELD_FLAGS" won't work either.

    Can anyone confirm this?

  7. #7
    BoogieManTM's Avatar Active Member
    Reputation
    52
    Join Date
    May 2008
    Posts
    193
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you getting the unit reaction from the fields as well? Or do you have to figure that out based on faction?

  8. #8
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    public bool AffectingCombat { get { return (flags & 0x80000) == 0x80000; } }
    public bool IsLootable { get { return (dynamicflags & 0x0D) == 0x0D; } }

  9. #9
    luciferc's Avatar Contributor
    Reputation
    90
    Join Date
    Jul 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shynd to the rescue with his float skull guy!

    :P

  10. #10
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks seems to work now, was a fault on my side not correctly updating the "IsInCombat" output.


    A question regarding the "unit reaction" mentioned in the threadtitle, are there any speicific "Flags" which indicate if the unit is friendly, hostile or neutral?

    Or do I have it to do it the complicated way via the "CompareFactionHash" method shynd posted?

  11. #11
    boomingranny's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im sure there is a much better way of doing it,
    but i currently write a macro to memory that does: /cleartarget [noharm]
    then i test if i still have a target.

  12. #12
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm okay,
    anyone knowing a fair out of process solution or the UnitReaction problem? (besides getting the lua return value).

    Otherwise I guess I have to use shynd's method GetUnitReaction « Shynd’s WoW Modification Journal

    At least I would try to use it, but I can't find the offsets to the pointer he is using.
    Any chance on a hint where I have to search for these pointer offsets?

Similar Threads

  1. Camping spot (WSG for flag and players)
    By Lappe in forum World of Warcraft Exploits
    Replies: 11
    Last Post: 04-20-2008, 01:28 PM
  2. [Flag Swap] Horde flag --> Alliance flag and reverse
    By Viter in forum World of Warcraft Model Editing
    Replies: 9
    Last Post: 03-21-2008, 04:17 AM
  3. Much more flags and banners :D
    By Thirsha in forum World of Warcraft Emulator Servers
    Replies: 17
    Last Post: 02-22-2008, 10:30 PM
  4. Flags and banner game objecs
    By Thirsha in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-22-2008, 07:37 AM
  5. Npc factions , Emotes and flags and some commands
    By EmiloZ in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 11-10-2007, 01:23 PM
All times are GMT -5. The time now is 10:13 AM. 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