-
Member
[Retail] Unit is boss
Hello !
I'm trying to find a way to know if a unit is a boss or not ( externally if possible, without lua function call ) in Wow retail.
I found the data related to creature classification
Code:
public enum WoWClassification
{
Normal = 0,
Elite = 1,
RareElite = 2,
WorldBoss = 3,
Rare = 4
}
But in raid or dungeon bosses seems to be considered as "Elite" only.
Any idea of how to get this information ?
-
Member
Originally Posted by
Lumi666
Hello !
I'm trying to find a way to know if a unit is a boss or not ( externally if possible, without lua function call ) in Wow retail.
I found the data related to creature classification
Code:
public enum WoWClassification
{
Normal = 0,
Elite = 1,
RareElite = 2,
WorldBoss = 3,
Rare = 4
}
But in raid or dungeon bosses seems to be considered as "Elite" only.
Any idea of how to get this information ?
Can only speak of Classic, this used to work for me on raid bosses. Haven't checked in a while, but you'll find the offset around that area if it has changed.
Pointer = 0x500
GatherType = 0xe8
Code:
public bool IsBoss
{
get
{
try
{
int ret = (Memory.Read<int>(Memory.Read<IntPtr>(BaseAddress + Fields.Unit.DBCacheRow.Pointer) + Fields.Unit.DBCacheRow.GatherType) >> 2) & 1;
return (ret == 1);
}
catch (Exception e)
{
Logging.WriteError(e);
return false;
}
}
}
-
Post Thanks / Like - 1 Thanks
Lumi666 (1 members gave Thanks to darheroc for this useful post)
-
I know you said in specifics without a lua function, if possible, but for anyone else I believe the appropriate lua function to do this would be UnitClassification
-
Contributor
Code:
class UnitInfo {
public:
FIELD(uint32_t, GetType, 0x30);
FIELD(uint32_t, GetFamily, 0x34);
FIELD(uint32_t, GetUnitRank, 0x38);
FIELD_OBJ(char*, GetName, 0xF8);
FIELD(uint32_t, GetGatherType, 0xE8);
};
Code:
enum UnitRank
{
Normal = 0,
Elite = 1,
RareElite = 2,
Boss = 3,
Rare = 4
};
Code:
if (entity->GetType() == TypeId::CGPlayer || entity->GetType() == TypeId::CGActivePlayer) {
if (entity->GetUnitInfo()->GetUnitRank() == UnitRank::Normal) {
RenderTextWithDynamicSize("Normal", ImVec2(OPPos.x, OPPos.y - 50.f), GameUtils::GetClassColor(entity), distance);
}
else if (entity->GetUnitInfo()->GetUnitRank() == UnitRank::Elite) {
RenderTextWithDynamicSize("Elite", ImVec2(OPPos.x, OPPos.y - 50.f), GameUtils::GetClassColor(entity), distance);
}
else if (entity->GetUnitInfo()->GetUnitRank() == UnitRank::Boss) {
RenderTextWithDynamicSize("Boss", ImVec2(OPPos.x, OPPos.y - 50.f), GameUtils::GetClassColor(entity), distance);
}
}
-
Post Thanks / Like - 1 Thanks
Lumi666 (1 members gave Thanks to maikel233 for this useful post)
-
Member
GatherType is perfect ! Thanks !
-
Contributor
"GatherType" is a bitfield flag, some known values is as:
Code:
[Flags]
public enum WoWCreatureTypeFlags : uint
{
Tameable = 0x1,
GhostVisible = 0x2,
Boss = 0x4,
HerbSkin = 0x100,
MineSkin = 0x200,
MountedCombatAllowed = 0x800,
Salvageable = 0x8000,
Exotic = 0x10000,
QuestBoss = 0x80000000
}
-
Post Thanks / Like - 1 Thanks
ByteWielder42 (1 members gave Thanks to air999 for this useful post)
-
Member
-- NVM I'm dumb
Last edited by Lumi666; 01-17-2024 at 04:18 AM.