How does GetAttributeValue work? menu

User Tag List

Results 1 to 9 of 9
  1. #1
    thetest1's Avatar Active Member
    Reputation
    26
    Join Date
    Feb 2018
    Posts
    24
    Thanks G/R
    5/24
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How does GetAttributeValue work?

    The definition is
    Code:
    double GetAttributeValue(IAttribute attribute, uint modifier, double defaultValue = -1.0f);
    but what is "modifier" and what is "defaultValue"?
    the only use i found so far of the function is
    Code:
    GetAttributeValueAsInt(Hud.Sno.Attributes.Power_Buff_1_Visual_Effect_None, Hud.Sno.SnoPowers.OculusRing.Sno) == 1
    to get occulus, and
    Code:
    GetAttributeValue(Hud.Sno.Attributes.Power_Buff_0_Visual_Effect_None, 264185, 0)
    to get illusionist.
    Those seem to check if a certain buff is active but how do you get the actual attributes?
    for example
    Code:
    monster.GetAttributeValue(Hud.Sno.Attributes.CrowdControl_Reduction,
    what would be the modifier/defaultValue?

    How does GetAttributeValue work?
  2. #2
    User5981's Avatar First Dev On The Internet
    Reputation
    379
    Join Date
    Aug 2017
    Posts
    765
    Thanks G/R
    30/358
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm also interested in an answer to that question,
    it looks like the modifier should be the sno of the attribute but it looks like some don't have a sno number (or are unknown to us).
    I'm trying to get item durability for a new plugin

    Item.GetAttributeValue(Hud.Sno.Attributes.Durability_Cur,?,-1.0f);

    but it's not clear what the modifier should be...
    Supported version for all Resu plugins

  3. #3
    hkjhkh's Avatar Member
    Reputation
    9
    Join Date
    Mar 2018
    Posts
    82
    Thanks G/R
    0/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any update ? I would be interest to if it's possible to get Buff is on monster active over this function.

  4. #4
    DysfunctionaI's Avatar Member
    Reputation
    6
    Join Date
    Feb 2010
    Posts
    60
    Thanks G/R
    19/5
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    modifer = unit.MaxValue

    Don't change default value if you don't care.

    Afaik, you won't be able to read those attributes, just the ones that show up in 'logs/dump_actors_on_screen.txt' after doing a debug (ctrl+alt+D)
    Last edited by DysfunctionaI; 01-15-2019 at 12:19 PM.

  5. #5
    thetest1's Avatar Active Member
    Reputation
    26
    Join Date
    Feb 2018
    Posts
    24
    Thanks G/R
    5/24
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried
    Code:
    var monsters = Hud.Game.AliveMonsters.Where(x => x.IsAlive);
                foreach (var monster in monsters)
                {
                    var test1 = monster.GetAttributeValue(Hud.Sno.Attributes.CrowdControl_Reduction, uint.MaxValue);
                    var test2 = monster.GetAttributeValueAsInt(Hud.Sno.Attributes.CrowdControl_Reduction, uint.MaxValue);
                    var test3 = monster.GetAttributeValueAsUInt(Hud.Sno.Attributes.CrowdControl_Reduction, uint.MaxValue);
                    var hptext = ": " + test1 + " " + test2 + " " + test3;
    but the result was just constant even after applying cc
    https://i.imgur.com/LlOIZRP.png
    Am i using the function wrong or is ther just no support for monster attributes?
    I basically want something like
    Code:
    public static bool isBuff(int SnoPowerID, ActorCommonData acd)
    {
        try
        {
            acd.TakeSnapshot();
            if (acd.x000_Id != -1)
            {
                var attributes = acd.EnumerateAttributes();
    			foreach (var attrib in attributes)
                {
                    uint attribId = (uint)(attrib.x04_Key & 0xFFF);
                    uint modifier = (uint)(attrib.x04_Key >> 12);
                    int value = attrib.x08_Value.Int32;
    
                    if ((int)modifier == SnoPowerID && value > 0)
                    {
                        acd.FreeSnapshot();
                        return true;
                    }
                }
            }
            acd.FreeSnapshot();
            return false;
        }
    catch { return false; }
    };
    from helper

  6. #6
    User5981's Avatar First Dev On The Internet
    Reputation
    379
    Join Date
    Aug 2017
    Posts
    765
    Thanks G/R
    30/358
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you need to press F3 in between?
    Supported version for all Resu plugins

  7. #7
    DysfunctionaI's Avatar Member
    Reputation
    6
    Join Date
    Feb 2010
    Posts
    60
    Thanks G/R
    19/5
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by thetest1 View Post
    I tried
    Code:
    var monsters = Hud.Game.AliveMonsters.Where(x => x.IsAlive);
                foreach (var monster in monsters)
                {
                    var test1 = monster.GetAttributeValue(Hud.Sno.Attributes.CrowdControl_Reduction, uint.MaxValue);
                    var test2 = monster.GetAttributeValueAsInt(Hud.Sno.Attributes.CrowdControl_Reduction, uint.MaxValue);
                    var test3 = monster.GetAttributeValueAsUInt(Hud.Sno.Attributes.CrowdControl_Reduction, uint.MaxValue);
                    var hptext = ": " + test1 + " " + test2 + " " + test3;
    but the result was just constant even after applying cc
    https://i.imgur.com/LlOIZRP.png
    Am i using the function wrong or is ther just no support for monster attributes?
    That's why I said you probably can't read those attributes. You probably return those numbers cuz that attribute hasn't been populated in memory.

    Originally Posted by thetest1 View Post
    I basically want something like
    Code:
    public static bool isBuff(int SnoPowerID, ActorCommonData acd)
    {
        try
        {
            acd.TakeSnapshot();
            if (acd.x000_Id != -1)
            {
                var attributes = acd.EnumerateAttributes();
    			foreach (var attrib in attributes)
                {
                    uint attribId = (uint)(attrib.x04_Key & 0xFFF);
                    uint modifier = (uint)(attrib.x04_Key >> 12);
                    int value = attrib.x08_Value.Int32;
    
                    if ((int)modifier == SnoPowerID && value > 0)
                    {
                        acd.FreeSnapshot();
                        return true;
                    }
                }
            }
            acd.FreeSnapshot();
            return false;
        }
    catch { return false; }
    };
    from helper
    That's what the debug hotkey does. It's Ctrl+Alt+D by default, I believe (check config/hotkeys.txt)
    Then look in the 'logs' folder for dump_actors_on_screen.txt
    You'll see all accessible attributes there, relative to each actor.

  8. Thanks thetest1 (1 members gave Thanks to DysfunctionaI for this useful post)
  9. #8
    thetest1's Avatar Active Member
    Reputation
    26
    Join Date
    Feb 2018
    Posts
    24
    Thanks G/R
    5/24
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i got it now thanks for your help.
    I made
    MissingCursesPlugin
    out of this.

  10. #9
    DysfunctionaI's Avatar Member
    Reputation
    6
    Join Date
    Feb 2010
    Posts
    60
    Thanks G/R
    19/5
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ooo sexy credit

Similar Threads

  1. How Does PVP Work?
    By Binary in forum MMO Exploits|Hacks
    Replies: 1
    Last Post: 09-23-2008, 11:01 PM
  2. [Question]Suspended-how does it work?
    By Eyesofhatred in forum World of Warcraft General
    Replies: 0
    Last Post: 08-21-2008, 08:45 AM
  3. How does "Playeritems" work?
    By thijsd in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 07-12-2008, 02:21 PM
  4. how does fishbuddy work??
    By Zanatons in forum World of Warcraft General
    Replies: 1
    Last Post: 08-26-2006, 07:56 PM
  5. auto-it? how does it work
    By Krazzee in forum World of Warcraft General
    Replies: 4
    Last Post: 06-22-2006, 02:28 AM
All times are GMT -5. The time now is 07:38 AM. 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