A quick note before I continue, according to Necrolis, this is something that Adhin has found many years ago, however, I did it completly independently and so here you may find description of the exact problem and solution of it.
Now, according to our txt files guides:
This is how it's supposed to work. Unroftunately, it does nothing.MaxLevel - An extremely powerful but badly underused field. This controls the point at which this affix will no longer appear on items. Say we have a Level of 10 and a MaxLevel of 15, then the affix will only appear on items with a iLvl of 10-15, whereas it will never appear on items with iLvls 1-9 and 16-99. This is the easiest way to get those crappy low-level affixes of higher level drops to ensure that those are useful.
Here is a piece of code I have received from Necrolis, which shows how affix level is selected:
Code: Select all
if ( nLevelBonus )
{
nAdjustedItemLevel = nLevelBonus + nItemLevel;
}
else
{
nHalfSpawn = nSpawnLevel / 2;
nInverseHalfSpawn = 99 - nSpawnLevel / 2;
if ( nItemLevel >= nInverseHalfSpawn )
nAdjustedItemLevel = 2 * nItemLevel - nHalfSpawn - nInverseHalfSpawn;
else
nAdjustedItemLevel = nItemLevel - nHalfSpawn;
}
if ( nAdjustedItemLevel > 1 )
{
if ( nAdjustedItemLevel >= 99 )
nAffixSelectionLevel = 99;
else
nAffixSelectionLevel = nAdjustedItemLevel;
}
else
{
nAffixSelectionLevel = 1;
}
Explaination is done, how do we fix it then? (EDIT: in case of anyone wondering about it, it's in d2game.dll)Necrolis wrote:If your item has a magic lvl ('magic lvl' column field) bonus set in weapons/armor/misc, the affix selection level is the item level + the bonus. If there is no bonus, the affix level is wonderfully gimped by the following:
Which produces this graph of affixesCode: Select all
nHalfSpawn = nRequiredSpawnLevel / 2; nInverseHalfSpawn = 99 - nRequiredSpawnLevel / 2; if ( nItemLevel >= nInverseHalfSpawn ) nAffixSelectionLevel = 2 * nItemLevel - nHalfSpawn - nInverseHalfSpawn; else nAffixSelectionLevel = nItemLevel - nHalfSpawn;
TL;DR: the 'magic lvl' is OP at pretty much any level.
Also, for the purposes of picking affixes, if the items required spawn level is greater than its item level, the required spawn level is used instead of the item level.
1.10:
Code: Select all
6FC52D70 |. /74 04 JE SHORT D2Game.6FC52D76
Code: Select all
6FC52D70 90 NOP
1.13c:
Code: Select all
6FC34617 |. /74 04 JE SHORT D2Game.6FC3461D
Code: Select all
6FC34617 90 NOP
Big thanks to Necrolis for helping me with this.