Item Generation Tutorial for Patch 1.11 (v1.0)

Something I forgot to add, there is a bug which does make it possible for them to spawn, but is horrendously rare. Thrugg had a theory on it, which went like this: A staffmod is set to spawn on an item, and the second or third gets set to spawn the same skill as the first and gets reset, which would then allow the dis-allowed skills to spawn on that particular item.
 
I'm quite sure that this theory isn't true as the function would check if a skill was also selected to prevent +6 Skillboni.

Is the generation of rares the same or could they get the barbarian skills?

And was something changed with the itemgeneration regarding barbarian helms or is this still the same procedure?
 
@Recrehal: The guy claimed, that he found it in 1.10 and that he is sure about this, thouh it was quite a while ago. So it is still possible, that his memory is not right and he found it in version 1.09. And I think possible staffmods changed between version 1.09 and 1.10 - in 1.11 they didn´t change as far as I know - at least not drastically. But I am not the expert here... :D

@RTB: Leap being the only possible combat skill on barbarian helms sounds very plausible to me - at least it fits perfectly into my own experience. It seems that you are the first one bringing some light into that meanwhile endless diskussion about barbarian helms we had. So thank you very much for the informations! And the possible bug you were talking about doesn´t fit to the mentioned whirlwind helm, because there is no second skill on it. It is a grey one with only +3 ww.
 
Recrehal said:
I'm quite sure that this theory isn't true as the function would check if a skill was also selected to prevent +6 Skillboni.
Your argument is actually evidence for Thrugg's supposition. The game sees that it has selected the same skill twice. This isn't allowed, so it rerolls the second skill. This new roll could be it's own routine (where item type is not checked) or missing the item type parameter in a call to the old routine.

Recrehal said:
Is the generation of rares the same or could they get the barbarian skills?
Item quality does not matter, so no, the other barbarian skills would not be allowed.

Recrehal said:
And was something changed with the itemgeneration regarding barbarian helms or is this still the same procedure?
I believe the check of item type and certain skills only available on certain item types was introduced in 1.10. In any case, it is currently in the game.
 
In any case, the game would call a function that is called reroll instead of implementing it again, in a different way, though it was already implemented. So this theoery is most likly wrong if the guys at Blizzard have some sence of programming ;)

Hm ... I'm a bit dissapointed, though ;) I could use a Berserk helm.
 
So for the countess she has an equal chance to drop any of the runes? Or does she drop el/eld/tir kind of ones more often? In the 98% chance to drop El-Ist and 2.89% to drop El-Lo.
 
Indeed Hell Countess has about 98% chance to drop a rune from El-Ist range. However the chances for every rune are not equal. If she drops a rune from her special TC then she drops a rune from “Runes 12†TC. This TC has 2/5045 chance for Ist and 3/5045 chance for Mal.

Calculating exact drop chance per a Countess run is not a simple task, because her drops are complicated. ATMA uses an approximation of it to give you average numbers.

To calculate her exact chances at runes you should sum all her chances to drop a rune in every possibility. She may drop from 0 up to 6 runes and each rune may come from one of two countess rune sources. So it will be quite a few combinations. I hope to find a time to do these calculations someday.
 
Some comments on object drops.

Warrior of Light said:
Each chest has (monlvl1/2 + 8)/100 chance to have a lock. It is important, because locked chests usually drop more items (monlvl1 is a field from levels.txt file).

If I recall correctly, a locked chest makes two TC drops. That is, it basically calls the function that takes the TC and drop items from it twice.

Warrior of Light said:
Chests drop items exactly like monsters, except they don't have 6 items cap and they drop from their own TCs.

Actually the 6 items cap is hard coded into the function that makes drops from a TC, regardless of source (unless they changed it in 1.11, but I doubt that). It is hard coded not only as a "stop after 6 items" but the data structures used and so on only handle max 6 items.

The reason you can see more than 6 items from some sources is that the game can of course make more than one "TC drop", that is, it might call the function for droping items from a TC more than once. This only happens for certain objects (typically chests). Not sure if it ever happens for monsters. In addition, special quest drops can occur on top/instead of the normal drop.

Warrior of Light said:
As Jarulf found, sparkling chests have six options with the fallowing chances:

Note that the information here is not completely accurate since when I looked at it, I unfortunately assumed a drop from a chest TC must at least drop an item and can't end up as an empty drop with no item at all. Since chest TCs has a non 0 NoDrop, that is not the case and in those cases there are additional drop mechanisms for the sparkling chests that I simply ignored when I wrote it up. It should not have a huge impact on the resulting drop, but it DO affect it in sometimes.
 
Recrehal said:
In any case, the game would call a function that is called reroll instead of implementing it again, in a different way, though it was already implemented. So this theoery is most likly wrong if the guys at Blizzard have some sence of programming ;)

Hm ... I'm a bit dissapointed, though ;) I could use a Berserk helm.

They can of course have completely rewritten that code, but it used to simply be a loop that randomly picked a skill, check if it was allowed (it check if it was one of the non allowed, for example Poison dagger) and if it had not yet been picked. If so, it was added, otherwsie it looped and picked a new random skill and so on. There was no special code for the initial pick or the folowing picks if the first was not OK. I don't think I ever looked at this code in 1.10 though so they might have changed it. I think they moved it to d2common.dll in 1.10 or possibly in a patch earlier or so though.
 
The code hasn't been completely rewritten, everything about the skill, slvl etc selection is the same, but in 1.11 (and I guess 1.10 as well, judging from what I've read) theres now a new factor that can limit skills to spawn on certain item types. In 1.09 the only skill that couldnt spawn on items (iirc) was poison dagger, which was a hardcoded check. Now, as RTB mentioned before, the itypea1 column in skills.txt (ONLY itypea1, not the rest if the itypexx columns or the etype ones) tells what items the specific skill can spawn on. However, this new function seems to have been implented rather poorly.

After it has selected a 'skill tier' (see first post) to choose a skill from, it loops SIX TIMES (for each skill) to see if it can find a valid skill (a valid skill must have matching itypea1 to the items type and it must not have already been selected). Each loop it randomly selects a new skill from the chosen tier, and checks if it is ok. If, however, it fails all 6 times to find a valid skill, it will STILL go on and select the skill that it tried last. And, it will not add that skill to the selected skills list, so it could select the same skill twice (not sure if it would simply add the skill levels together, or overwrite the first one).

Hopefully this will shed some light on things.
 
In other words, if the skills all end up to be invalid there is a chance to pick an invalid skill?

I'd like to calculate the chance for that. Are all skills selected equally or will it pick certain skills with priority, assuming we want a lvl 30 skill like berserk or whirlwind?
 
Hammermann said:
However, this new function seems to have been implented rather poorly.

Is it just me or is the whole patch poorly implemented? I have seen a whole lot of bad things, crappy implementation and broken things. Seems the new patch people really don't understand the game, or simply can't do things properly :)

Is this whole thing still in d2common? You know the number of the exported function for this? Just in case one want to look at it :)
 
Oh! I understand it now. Say, if the game selects Whirlwind SEVEN times then it generates a WW helm (or any combat skill at first six steps). Did I get it right?

I think the game may use the similar algorithm when selecting shrines. “High level shrine†cannot spawn in low level areas (see shrines.txt), however I do meet them. For example today I met Resist Cold Shrine in Stone Field.
 
Warrior of Light said:
Oh! I understand it now. Say, if the game selects Whirlwind SEVEN times then it generates a WW helm (or any combat skill at first six steps). Did I get it right?
I don't think so. It sounds like if the first 5 attempts are any combat skills (other than leap), and then the 6th attempt is X, then it will select X no matter if X is valid or not.
 
What about an item that gets three automods? Does that mean three times a chance to get whirlwind or are up to 6 skills selected and then up to three of them selected to be on the item?
 
Recrehal said:
In other words, if the skills all end up to be invalid there is a chance to pick an invalid skill?

I'd like to calculate the chance for that. Are all skills selected equally or will it pick certain skills with priority, assuming we want a lvl 30 skill like berserk or whirlwind?

Yes, if it fails to find a valid skill six times, the skill it tried last (the sixth attempted skill) will be selected. Example:

Barbarian tier 6 skills are (equal chance for all skills to be picked, 1/5):

Whirlwind (itype1a = mele)
Berserk (itype1a = mele)
Natural Resistance
War Cry
Battle Command

Say that the game selects tier 6 to pick from (10% chance if ilvl > 36) on a Jawbone cap, and to add 2 skills. It could go something like this:

1st skill = War Cry
2nd skill = Berserk (invalid, itype1a = mele , retry) (1)
------- = War Cry (invalid, already selected, retry) (2)
------- = War Cry (invalid, already selected, retry) (3)
etc, with reroll 4 and 5 also getting invalid skills
------ = Whirlwind (invalid, itype1a = mele) (6)

But now it has tried six times and failed, so it selects Whirlwind even if it is invalid, although it doesnt add it to the selected skills list (but I guess that is rather irrelevant here).

TheJarulf said:
Is this whole thing still in d2common? You know the number of the exported function for this? Just in case one want to look at it

Nah, its in d2game, at 6FCA91C0 (1.11). It's in a similar location as it was in 1.09 (altough it is somewht changed), when its doing quality-specific things, and sockets, affixes, and things like that.

Warrior of Light said:
Oh! I understand it now. Say, if the game selects Whirlwind SEVEN times then it generates a WW helm (or any combat skill at first six steps). Did I get it right?

No, thegiantturtle has it right, if it fails 5 times it will select the 6th skill it tries no matter what. But you're right about the shrines, it selects an effectclass group and randomly selects a shrine from it. If the levelID is lower than the shrines minlevel (from shrines.txt) it tries again. If it doesn't find a shrine which is within the level limit after 8 tries, it selects the last shrine it tried. Or so it was in 1.09.
 
RTB said:
Good stuff. You might want to add some more info on the drop rate of the new Keys, but the rest seems ok. Minor nit at section 22: Elite wands do not have magic_lvl.

I uploaded the .txt files you explain here.

"Levels.txt" is not in that text-file - where can I find that?
 
That file only has the .txt files described here, and here's the link to all 1.11 .txt files. You could problably find them at the Phrozenkeep too.
 
Warrior of Light said:
19. Crafting

Crafted items are always creates it the cube using Rune+Jewel+Gem+Item recepe.

I'll directly quote Uzziah here.



Again, see chapter 11 for algorithm of affix selection.

20. Imbuing

Written by Uzziah.



21. Cubing

Cubing is a process of creating items by player in The Horadric Cube.

Written by Uzziah.



22. Circlets and Magic Level

In chapter 11 you may found the following algorithm of affix selection.

When an item is generated that has prefixes 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.

Let me attract your attention to lines number 2 and 3. They means that 1) Ilvl for affixes cannot be lower than qlvl of given item, 2) if the item has magic lvl, than it receives much higher alvl.

What is magic_lvl? It is Magic level, special bonus for special items. It could be found in weapon.txt and armor.txt files. All Wands, Staffs and Orbs have magic_lvl=1. Circlets have magic_lvl=3, Coronets have magic_lvl=8, Tiaras have magic_lvl=13, Diadems have magic_lvl=18. Other items don't have it.

Look at Diadems. They have Qlvl=85 and magic_lvl=18. This means that they ALWAYS have Alvl=99. Refer to above algorithm for details.

Look at Tiaras too. They have Qlvl=70 and magic_lvl=13. So Tiaras always have Alvl=83+.

23. Rune making in Hell Forge

The Hellforge is the second quest in Act IV. In Normal difficulty this quest rewards you with a rune from El-Amn range, in Nightmare - Sol-Um, in Hell - Hel-Gul. The chance for every rune to be dropped is 1/11.

Hellforge runs is popular in multiplayer games, where fast teleporting character can level new character to Hell Hellforge in very shot period of time.

24. Magic Finding

Magic Finding (MF) deserves special chapter, because all you can do to increase your chances to find good items from certain monster in players1 mode is only to increase your MF.

What is MF? It is "+% Better Chance of Getting Magic Item" property, that can be found on many items in the game, topazes are most popular of them.

What MF do? It increases your chances at magic, rare, set and unique items. 100% MF doesn't means that all items, that you find will be magic. It means, that the chance of item to be magic will be doubled. MF have diminishing returns for finding rare, set and unique items.

What is MF diminishing returns?
Effective MF=(MF*Factor)/(MF+Factor),
where Factor=250 for unique items, 500 for set items and 600 for rare items.

Is there a cap on MF? Yes, implicitly. When you stack up your MF your increase your chance to find unique, set, rare and magic items. There is a cap on this chances. For example the cap in unique item chances for Act bosses is 50% (calculates from itemratio.txt as 128/(6400-(6400*983/1024))). Practically you'll never reach this cap, so don't afraid to increase your MF.

Will MF work on Runes? No. MF works only when item type is already selected. So with more MF you will NOT get more weapons and armors and less runes.

Will MF help getting better Items from Gambling? No.

Will MF work with Minions and Hirelings? Yes. When you make a kill, you get the MF% of yourself only. When a Hireling gets a kill, it uses the combined MF of the Hireling and you.

Does number of players in the game increase the chances for an item to be unique? No, it just increases number of dropped items and thus the number of unique items found. Only MF increases the chances for an item to be unique.

Does MF work on chests? Yes, MF DOES work on every objects: chests, rocks, dead bodies, urns, etc. See chapter 17 for exact description of object drops. Special chest have fixed quality chances, though.

How exactly MF works? It increases the chances for item to be unique/set/rare/magic by EffectiveMF/100 times. For example, Baal dropping an Unearthed Wand has 128/1984 chance to generate unique when you have 0% MF and 128/992 chance, when you have 167% MF.

25. 1.11 Drop Changes

As you know this patch didn’t change much. Most updated was dedicated to new Uber bosses.
So the only thins that changed in the game is:
— Fangskin no more drop items in Hell
— Countess, Summoner and Nihlathak drop keys, that slightly reduce there other drop chances.

26. Thanks

I'd like to name here all, who helped me to write this guide, in acknowledgement to their deeds, however their list is too long. :(
However I tried to name those, whose materials was used, in every chapter. I'm really sorry if I used someone's discovery and not figured his name, I didn't want to do so.

The BIGGEST thanks goes to Blizzard, that has created the games, that gave us countless hours of fun and joy, Diablo and Diablo II!

Oh! Thank you for reading it!
Have fun,
Sincerely yours, Warrior of Light.

Thanks for posting this guide, it helped me out with a few things.
I do still have a question/request.

I would like to craft some gloves and ammys. I would like to up my chances to get + to skill mods on these. What clvl should I use and what item type (i.e. demonhide sash or arachnid mesh) would be best to use? I do not know ilvls of all these items. Can I look @ rlvl on the items to *guess* ilvl?
Basically what lvl char should I use and would it be best to use exceptional or elite item class types? I hope this is clear.
Thanks
 
raivyne said:
Thanks for posting this guide, it helped me out with a few things.
I do still have a question/request.

I would like to craft some gloves and ammys. I would like to up my chances to get + to skill mods on these. What clvl should I use and what item type (i.e. demonhide sash or arachnid mesh) would be best to use? I do not know ilvls of all these items. Can I look @ rlvl on the items to *guess* ilvl?
Basically what lvl char should I use and would it be best to use exceptional or elite item class types? I hope this is clear.
Thanks
Use this link - affix calculator is there.




@Warrior of Light: This is the greatest guide I have ever seen and I use it alot, but I have some reports for a new version, if it will be released.

The section about calculating Item quality got screwed:
1) Find proper line in itemratio.txt.
2) Chance = (BaseChance - ((ilvl-qlvl)/Divisor)) * 128
3) if (we check for unique, set or rare quality) EffectiveMF=MF*Factor/(MF+Factor)
else EffectiveMF=MF
4) Chance= Chance* 100/(100+ EffectiveMF).
5) if (Chance 6) FinalChance=Chance-(Chance*QualityFactor/1024)
7) If (RND[ FinalChance ])<128 return Success
else return Fail
(errors are in chapter 4.8 and 8)

Also there is an inacurate thesis from thrugg:
That's step 1 Next, back to TreasureClassEx.txt we go. In normal you just look up directly the TC and off you go, but in NM and Hell we have "TC upgrades". This is what the two columns that I haven't explained yet are for - "group" and "level". In NM or Hell, if a monster's level is higher than the level of his base TC, and there is another TC in the same group which is higher level but still equal to or less than his monster level, it will upgrade to that TC.
We discussed this thing in this thread
 
Back
Top