-
Active Member
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?
-
First Dev On The Internet
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...
-
Member
any update ? I would be interest to if it's possible to get Buff is on monster active over this function.
-
Member
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.
-
Active Member
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
-
First Dev On The Internet
Maybe you need to press F3 in between?
-
Member
Originally Posted by
thetest1
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
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.
-
Post Thanks / Like - 1 Thanks
thetest1 (1 members gave Thanks to DysfunctionaI for this useful post)
-
Active Member
Ok i got it now thanks for your help.
I made
MissingCursesPlugin
out of this.
-
Member