There had been some questions on dibloii.net about the 3 chipped gem + sword formula and the possibility of getting a 'Cruel' prefix on a Balrog Blade. This lead me to re-examining the formulas for gettin gthe ilvl from the cube formulas and what the resulting alvls would be for these items. Here is a copy of the results that I posted at their forums.I finished the testing of the calculation of the new ilvl of an item in the cube formulas using the values of from the lvl, plvl and ilvl columns of the cubemain.txt file.
terms
lvl, plvl and ilvl are the values from the columns in cubemain.txt
clvl is the character level
ilvl_old is the ilvl of the item listed in the input 1 column of the cubemain.txt file (the ilvls from items in the other input columns are not used and there can only be a single item in input 1 for this to be a valid number)
if (lvl>0)
then {ilvl=lvl}
else {ilvl=int(plvl*clvl/100)+int(ilvl*ilvl_old/100)}
if (ilvl>99) then {ilvl=99}
*all calculations use integers so there are no fractions at any step.
I did not test for there being a minimum ilvl, but it probably is set for a minimum value of 1.
This means that for the 3 chipped gem + sword formula that the ilvl will be set to 30 for all swords. To figure the affixes that are possible on such a sword you will need to calculate the alvl for each swords qlvl and ilvl (30 in the case of the sword formula). The formula was orginally given by Jarulf and is listed here.
Terms
alvl = affix level. For an item this is the level that is used to compare to the level and max level as found in the prefix and suffix tables. When referring to a prefix/suffix it is the value listed in the level column.
ilvl = internal level (also referred to sometimes as the item level). This value is set at the time of an items creation. For monster drops the ilvl=mlvl. (BTW ilvl matches up with the terminology of the 1.07/1.08 cubemain.txt---'itemlevel pct a')
mlvl = monster level.
clvl = character level.
qlvl = quality level. This value is found in the level column of armor.txt, weapons.txt and misc.txt. This is the value that is used to create the weapXX and armoXX treasure classes.
magic_lvl = magic level bonus on some items. Currently the only ones that have this are wands (normal and exceptional, but not the elite ones), staves, orbs (all with a value of 1) and circlets (circlet=3, Coronet=8, Tiara=13, Diadem=18).
When an item is generated that has affixes the alvl is calculated* from ilvl and qlvl as follows
If (ilvl>99) then {ilvl=99}
if (qlvl>ilvl) then {ilvl=qlvl} ;** see note below
if (magic_lvl>0) then {alvl=ilvl+magic_lvl}
else
{
if (ilvl<(99-qlvl/2))
then {alvl=ilvl-qlvl/2}
else {alvl=2*ilvl-99}
}
If (alvl>99) then {alvl=99}
*all calculations use integers so there are no fractions at any step.
** this new ilvl value is only used for the duration of this calculation. The ilvl value that is stored in the items data file will remain unchanged.
For the 3 chipped gems +ANY sword the alvls are listed in the following table.
sword qlvl max of ilvl and qlvl alvl
Short Sword 1 30 30
Scimitar 5 30 28
Saber 8 30 26
Two-Handed Sword 10 30 25
Crystal Sword 11 30 25
Falchion 11 30 25
Broad Sword 15 30 23
Claymore 17 30 22
Long Sword 20 30 20
Giant Sword 21 30 20
Bastard Sword 24 30 18
Flamberge 27 30 17
War Sword 27 30 17
Gladius 30 30 15
Great Sword 33 33 17
Shamshir 35 35 18
Dimensional Blade 37 37 19
Espadon 37 37 19
Tulwar 37 37 19
Battle Sword 40 40 20
Dacian Falx 42 42 21
Cutlass 43 43 22
Rune Sword 44 44 22
Tusk Sword 45 45 23
Gothic Sword 48 48 24
Ancient Sword 49 49 25
Zweihander 49 49 25
Executioner Sword 54 54 27
Falcata 56 56 28
Legend Sword 59 59 30
Ataghan 61 61 31
Elegant Blade 63 63 32
Highland Blade 66 66 33
Hydra Edge 69 69 39
Balrog Blade 71 71 43
Phase Blade 73 73 47
Champion Sword 77 77 55
Conquest Sword 78 78 57
Colossal Sword 80 80 61
Cryptic Sword 82 82 65
Colossus Blade 85 85 71
Mythical Sword 88 88 77
From this only the last 6 swords on the list can get the 'Cruel' prefix.