1. Can I buy an item whose Qlvl is greater than my Clvl ?
2. What about the upgrading of base item to exceptional and elite?
3. In armor.txt decompressed from Patch_D2.mpq, it says Chain Gloves
will upgrade to Light Gauntlets in nightmare. But why i can still
get Heavy Bracers from Fara in nightmare games?
Sorry the first two questions have nothing to do with Mod making ;-)
Some questions about Shopping(v1.10)
Moderator: Nizari
-
Ruvanal
- Champion of the Light
- Posts: 365
- Joined: Sun May 26, 2002 1:16 am
Re: Some questions about Shopping(v1.10)
Sorry the first two questions have nothing to do with Mod making ;-)
If you do not know how something actually works, can you really be sure of what the results will be when you modify it?
1) Short answer, yes. Longer answer...
The shopped items will have an ilvl=clvl+5 of the character that causes them to spawn. The ilvls in normal difficulty are capped at
act 1: 12
act 2: 20
act 3: 28
act 4: 36
act 5: 45
in nightmare and hell there are not caps on the ilvl.
For a base item to be available in the shops requires that the qlvl<=ilvl. So even early in the game you can see things like a skull cap (qlvl=5) with a clvl=1 player.
2) Getting the base item and having the ilvl be 25+ are the primary requirements to get an upgrade. See below for more.
3) In nightmare the chance to do the upgrade from code to ubercode is checked before defaulting to the NightmareUpgrade is done. The hell upgrades are done differently (see below).
Excerpted from a Lurker Lounge thread during v1.09, but it basically still applies from every thing that I have seen in the game.
If you do not know how something actually works, can you really be sure of what the results will be when you modify it?
1) Short answer, yes. Longer answer...
The shopped items will have an ilvl=clvl+5 of the character that causes them to spawn. The ilvls in normal difficulty are capped at
act 1: 12
act 2: 20
act 3: 28
act 4: 36
act 5: 45
in nightmare and hell there are not caps on the ilvl.
For a base item to be available in the shops requires that the qlvl<=ilvl. So even early in the game you can see things like a skull cap (qlvl=5) with a clvl=1 player.
2) Getting the base item and having the ilvl be 25+ are the primary requirements to get an upgrade. See below for more.
3) In nightmare the chance to do the upgrade from code to ubercode is checked before defaulting to the NightmareUpgrade is done. The hell upgrades are done differently (see below).
Excerpted from a Lurker Lounge thread during v1.09, but it basically still applies from every thing that I have seen in the game.
"RE: Item Distribution at Vendor"
from Hammerman
In response to message #0
LAST EDITED ON 09-Oct-02 AT 11:12 PM (GMT)
I've only looked a little at npc item generation, but this is what I have gathered so far. It's a little bit complicated, and with my bad English the explanation might be hard to understand. So by all means, ask if there's something you don't get.
As ScoliosisMan said, ilvl = clvl + 5, with caps in normal (see his post). The game will build a list of items wich have at least 1 in the <npc>Max column in weapons/armor.txt file. Items that have qlvl higher than ilvl, will not spawn
If ilvl is less than 25, there's a 1 / (MagicMax + 1) chance that the item will skip the "less-than-magic" quality selection, where the chance to be upgraded from normal to superior is: if ilvl >= 10, 25%, else 15% (also, if the ilvl is less than 5, there's a 10% chance that it'll be low quality). The game will select the quality for a number of MagMax items this way. After that, the game continues to where it would have been if it had skipped this section.
Now the game will attempt to create the item with magic quality. There are two restrictions to this: 1) bitfield1 must be an odd number, 2) <npc>MagicLvl must be lower than ilvl. Number of magic items to create is rnd<(<npc>Max + adder)> + <npc>Min. Adder is 1 if ilvl is less than 25, else rnd<3> + 1.
After the quality has been chosen, it'll do the difficulty and excep/elite upgrading. The game will skip all upgrading if clvl is 25 or lower (iirc, in the beta this check wasn't done, and you could buy normal/socketed elite items with low level characters in Hell). If in nm, the chance for upgrade to exceptional is:
chance for excep = (ilvl * 64 + 4000) / 100,000
If it fails to upgrade to exceptional, it will use the item in NightmareUpgrade column.
In hell:
chance for elite = (ilvl * 16 + 1000) / 100,000
chance for excep = (ilvl * 128 + 5000) / 100,000
It will only upgrade to excep/elite item if HellUpgrade column is blank (or "xxx"), else use that item.
There's a separate code for misc items, wich I haven't look at yet. Maybe someone else knows the details of how they are spawned. I also haven't looked at how it determines if the item should be socketed.
Please let me know if there's anything missing or incorrect in the text above. As I said, I haven't looked at the code in much detail so I might have missed something.
Edit: Minor correction about NightmareUpgrade