Rukongai wrote: ↑Sat Mar 09, 2024 2:03 am
Hey Ash, this isn't directly related to your project, but i'm working on a thing of my own and am running into a roadblock
I have an array of bytes representing items. I'm able to extract the BaseTypeID, SubType ID, Forging Potential, and affixes from it.
What I cant seem to figure out is rarity, affix count (I've found a few bytes that seem to work fine until the item is unique), and implicit/affix rolls
Do you have any insight on the structure of these item objects or where I might look to find out? I've been pouring over dnSpy and trying to figure out unity explorer, but I'm at a loss. Ive checked each byte for various sizes of signed and unsigned ints and floats but nothing matches the values i'm expecting. I have a feeling that the game maps the rolled values/tiers in a way i'm not able to see
here is a link to a spreadsheet I have with a few item examples i'm working on since it seems i can't add bbcode tables here ->
[Link]
You are correct. The game does not store the actual data of the affixes in the item itself. Rather, it stores the number of rolls of that affix in an array, and then maps this number with the actual values of the affix stored somewhere else.
For example, to max out an item's affix, I do the following:
Code: Select all
foreach (ItemAffix o_ItemAffix in o_ItemDataUnpacked.affixes)
{
o_ItemAffix.affixTier = (byte)(6);
o_ItemAffix.affixRoll = byte.MaxValue;
}
When the game loads, it just looks at the tier setting and the number of rolls of that affix that it needs to add to the item. It then uses the tier values and then rolls that X number of times. Here, because I rolled it 255 times (byte.MaxValue), it will max out the item's value for that affix.
The actual values of affixes are stored in another class named AffixList. It can either be a SingleAffix (modifying a single property) or MultiAffix (modifying multiple properties, e.g. Swarmblade Form + Increased Damage in your Meruna example in the Google Sheet). There should be properties there named minRoll and maxRoll for every tier. See code below:
Code: Select all
foreach (AffixList.Tier e_AffixTier in e_SingleAffix.tiers)
{
e_AffixTier.minRoll = e_AffixTier.maxRoll * 5.0f;
e_AffixTier.maxRoll = e_AffixTier.maxRoll * 5.0f;
}
This is my code for making every minRoll be equal to maxRoll (removing the randomness) then multiplying them by 5.0f so that they have obscene amounts (more than is legal by affix definitions).