Hello,
today I tryed to get the enchantment id and name from my fishing rod and couldn't found any helpful things here around the forums,
so I started to get the needed informations.
Here are my findings:
to get the visible item enchant offsets:
Code:
int Id = 0;
for (uint Offset = (uint)Descriptors.ePlayerFields.PLAYER_FIELD_VISIBLE_ITEMS; Offset < (uint)Descriptors.ePlayerFields.PLAYER_FIELD_PLAYER_TITLE; Offset += 0x2)
{
Id++;
var Offset2 = Offset - (0x93 + 0x7) + 0x1;
Log.Output("PLAYER_VISIBLE_ITEM_" + Id + " = UNIT_END + 0x" + Offset2.ToString("X"));
}
reading the enchantmentid:
Code:
var PlayerBaseandDescriptors = Me.ObjectPointer + 0x8;
var MainHandEnchant = Memory.Read<ushort>(Memory.Read<uint>(PlayerBaseandDescriptors) + (uint)Descriptors.ePlayerFields.PLAYER_VISIBLE_ITEM_16 * 4);
if (MainHandEnchant != 0)
{
Console.WriteLine(EnchantmentName(MainHandEnchant));
}
reading enchant name from enchantid:
Code:
uint SpellItemEnchantment = 0xBFD960;
public struct SpellItemEnchantmentRec
{
public uint Id;
public uint unk1;
public uint unk2;
public uint unk3;
public uint unk4;
public uint unk5;
public uint unk6;
public uint unk7;
public uint unk8;
public uint unk9;
public uint unk10;
IntPtr _Name;
public uint unk11;
public uint unk12;
public uint unk13;
public uint unk14;
public uint unk15;
public uint unk16;
public uint unk17;
public uint unk18;
public uint unk19;
public uint unk20;
public uint unk21;
public uint unk22;
public uint unk23;
public string Name { get { return Memory.ReadCString((uint)_Name,255); } }
};
private string EnchantmentName(uint id)
{
DBC<SpellItemEnchantmentRec> spell2 = new DBC<SpellItemEnchantmentRec>((IntPtr)Memory.BaseAddress + Pointers.DBC.SpellItemEnchantment);
foreach (SpellItemEnchantmentRec spells in spell2)
{
if (id == spells.Id)
{
return spells.Name;
}
}
return "";
}
Credits to:
Bananenbrot for helping me out with the bytes of PLAYER_FIELD_VISIBLE_ITEMS
TOM_RUS for the out of process DBC reading source.
-Ryuk- & Kryso: Thread link
Robske: Post link