Originally Posted by
lumpy.123
Or does someone know a function to get the cache entry by the item entry?
I believe it's already been posted here.
Code:
0055BA30 DbItemCache_GetInfoBlockByID
00C0E2A0 CACHE_ITEM
I haven't verified the entire item cache struct, but I believe it's something like this:
Code:
[StructLayout(LayoutKind.Sequential)]
public unsafe struct ItemCacheRecord
{
//public uint ItemId;
public ItemClass Class; // id from ItemClass.dbc
public uint SubClass; // id from ItemSubClass.dbc
[MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.LPStr, SizeConst = 4)]
public string[] Name;
public uint DisplayInfoID; // id from ItemDisplayInfo.dbc
public ItemQuality Quality;
public ItemFlags Flags;
//public uint BuyCount;
public uint BuyPrice;
public uint SellPrice;
public InventoryType InventoryType;
public uint AllowableClass;
public uint AllowableRace;
public uint ItemLevel;
public uint RequiredLevel;
public uint RequiredSkill; // id from SkillLine.dbc
public uint RequiredSkillRank;
public uint RequiredSpell; // id from Spell.dbc
public uint RequiredHonorRank;
public uint RequiredCityRank;
public uint RequiredReputationFaction; // id from Faction.dbc
public uint RequiredReputationRank;
public uint MaxCount;
public uint Stackable;
public uint ContainerSlots;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public _ItemStat[] ItemStat;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public _Damage[] Damage;
public uint Armor;
public uint HolyRes;
public uint FireRes;
public uint NatureRes;
public uint FrostRes;
public uint ShadowRes;
public uint ArcaneRes;
public uint Delay;
public uint AmmoType;
public float RangedModRange;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public _Spell[] Spells;
public ItemBondType Bonding;
[MarshalAs(UnmanagedType.LPStr)]
public string Description;
public uint PageText;
public uint LanguageID;
public uint PageMaterial;
public uint StartQuest; // id from QuestCache.wdb
public uint LockID;
public uint Material; // id from Material.dbc
public uint Sheath;
public uint RandomProperty; // id from ItemRandomProperties.dbc
public uint Block;
public uint ItemSet; // id from ItemSet.dbc
public uint MaxDurability;
public uint Area; // id from AreaTable.dbc
public uint Map; // id from Map.dbc
public BagFamily BagFamily;
public uint ScriptId;
public uint DisenchantId;
public uint FoodType;
public uint MinMoneyLoot;
public uint MaxMoneyLoot;
public uint Duration;
public uint ExtraFlags;
#region Sub-structs
[StructLayout(LayoutKind.Sequential)]
public struct _Damage
{
public float DamageMin;
public float DamageMax;
public uint DamageType; // id from Resistances.dbc
};
[StructLayout(LayoutKind.Sequential)]
public struct _ItemStat
{
public uint ItemStatType;
public int ItemStatValue;
};
[StructLayout(LayoutKind.Sequential)]
public struct _Spell
{
public uint SpellId; // id from Spell.dbc
public uint SpellTrigger;
public int SpellCharges;
//public float SpellPPMRate;
public int SpellCooldown;
public uint SpellCategory; // id from SpellCategory.dbc
public int SpellCategoryCooldown;
};
[StructLayout(LayoutKind.Sequential)]
public struct _Socket
{
public uint Color;
public uint Content;
};
};