How does GetAttributeValue work? menu

These ads disappear when you log in.

Results 1 to 9 of 9
  1. #1
    thetest1's Avatar Active Member CoreCoins User
    Reputation
    16
    Join Date
    Feb 2018
    Posts
    13
    Thanks G/R
    5/15
    Trade Feedback
    0 (0%)

    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?

    These ads disappear when you log in.

  2. #2
    User5981's Avatar Contributor CoreCoins User
    Reputation
    308
    Join Date
    Aug 2017
    Posts
    625
    Thanks G/R
    27/291
    Trade Feedback
    0 (0%)
    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
    Hit the thanks button & give me reputation, DAMMIT!

  3. #3
    hkjhkh's Avatar Member
    Reputation
    4
    Join Date
    Mar 2018
    Posts
    25
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    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
    49
    Thanks G/R
    18/5
    Trade Feedback
    0 (0%)
    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 CoreCoins User
    Reputation
    16
    Join Date
    Feb 2018
    Posts
    13
    Thanks G/R
    5/15
    Trade Feedback
    0 (0%)
    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 Contributor CoreCoins User
    Reputation
    308
    Join Date
    Aug 2017
    Posts
    625
    Thanks G/R
    27/291
    Trade Feedback
    0 (0%)
    Maybe you need to press F3 in between?
    Supported version for all Resu plugins
    Hit the thanks button & give me reputation, DAMMIT!

  7. #7
    DysfunctionaI's Avatar Member
    Reputation
    6
    Join Date
    Feb 2010
    Posts
    49
    Thanks G/R
    18/5
    Trade Feedback
    0 (0%)
    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 CoreCoins User
    Reputation
    16
    Join Date
    Feb 2018
    Posts
    13
    Thanks G/R
    5/15
    Trade Feedback
    0 (0%)
    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
    49
    Thanks G/R
    18/5
    Trade Feedback
    0 (0%)
    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 12:42 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search