Description: by Char
Categories: File Guides (1.1x)
This is based on no other fileguide because the differences between the 1.09 and 1.10 ItemStatCost.txt are extreme.
the name of the stat
the ID of the stat
This is most likely used to determine if this stat is sent to other users when in multiplayer. Only those stats are sent that are important for graphics (faster attack / cast / gethit rate). For some reason, dex and strength are sent, too.
Is the stat signed or not? -> Can this stat be negative or not?
Number of bits used to send this value between client and server.
Has something to do with client / server things, too.
Probably a boolean that tells the client to update the characters animation rate.
Is the stat saved when the character is saved?
Other stats are saved in the item saves.
(Character Save Signed)
Stat signed in character save?
(Character Save Bits)
Bits used to save when saved in character save file (maximum value that is saved equals 2^[CSvBits])
(Character Save Parameter)
Has something to do with saved parameters for some stats
related to how the thing is encoded
Add, Multiply, Divide
used to calculate the items price
the formula is:
price = base_price * (1+ stat_value * ([multiply]/[divide])) + [add]
base_price = base item price (from the other .txt files)
stat_value = amount of the stat that is on the item (for +8 strength this would be 8...)
if there is more than one stat on a magic item, the suffix ONLY counts for some reason i dont understand (this is reported by Joel). no idea what happens for rare items. for unique and set items, these values do not count at all.
divide cannot be changed for some reason, better leave it at 1024.
other files may modify the price, too (magicprefix / suffix has add / multiply / divide fields, npc.txt says something about sell / buy multipliers, ...).
Value is shifted by that. 1 would mean that its shifted by 1 which is a multiplication by 2. ValShift 2 is a multiplication by 4 and ValShift 8 equals a multiplication by 256 (2^8=256). This is done because, for example, hitpoints are internally calculated with 1/256 step precision.
1.09-Save Bits, 1.09-Save Add
The old Save Bits and Save Add values from 1.09. probably used for converting characters.
Save Bits, Save Add
These two fields are used to handle the way the value is saved on an item. This also determines the minimum and maximum values a stat can have.
Save Bits determines the number of bits the value is saved in, while Save Add is added before the value is saved unsigned.
Minimum stat value equals -[Save Add]
Maximum stat value equals 2^[Save Bits] - [Save Add] - 1
Example (taken from maxhp):
Save Add = 32
Save Bits = 8
Minimum stat value = -32
Maximum stat value = 2^8 - 32 - 1 = 256 - 33 = 223
Determines how many bits are used to save Parameters (???)
Boolean, can the stat go negative? (1 = cannot be negative)
This is the number of the operator used to calculate the effects of the item stat.
Known numbers and effects:
1 : op stats are increased by [statvalue] percent
2 : op stats are increased by [statvalue] * [op base] / 2^[op param]
3 : not used, effect unknown
4 : seems to have the same effect as 2
5 : op stats are increased by [statvalue] * [op base] / 2^[op param] percent
6 : op stats are increased by time
7 : op stats are increased by time and percent
8 : used to calculate the mana based on energy
9 : used to calculate the hitpoints and stamina based on vitality
op stat1 - op stat3
The op stats. See op
If the stat adds to another stat, too, this is set to 1. For example, when equipping an item with +30 mana, your maximum mana increases as well.
The max stat the stat adds to (when direct is set to 1)
Is this stat specific to one item only (and does therefore only affect this item)?
you should be able to stop the second weapon from increasing your first weapons attack speed this way
Does this stat relate to damage (dont know the effect)
When this event happens, the itemeventfunc1 is executed
Function that is executed on itemevent1. Functions that are used are:
6 : attacker takes damage of [statvalue]
7 : knockback
8 : howl effect
9 : stupidity effect
10 : attacker takes lightning damage of [statvalue]
14 : freeze effect
15 : openwounds effect
16 : crushing blow
17 : get mana (after kill)
18 : get life (after demon kill)
19 : slow effect
20 : skill is released
21 : skill is released (same as 20 ?!?)
28 : get life (after kill)
29 : slain monster rests in peace
30 : skill is released (same as 20 ?!?)
31 : reanimate slain monster
priority of the description on the item. The higher this, the earlier will the stat be displayed on your item. Not sure, though
Function used to display the stat. There are numerous ones, I didnt yet test all yet.
some values and what they display (descval used: 1, see below):
1 : +[value] [string]
2 : [value]% [string]
3 : [value] [string]
4 : +[value]% [string]
5 : [value/1.28]% [string] // used for howl
6 : +[value] [string] [string2]
7 : [value]% [string] [string2]
8 : +[value]% [string] [string2]
9 : [value] [string] [string2]
10 : [value/1.28]% [string] [string2]
11 : Repairs 1 durability in [100/value] seconds
12 : +[value] [string] // used for stupidity, freeze
13 : +[value] to [class] skill levels
14 : +[value] to [skilltab] skills ([class] only)
16 : Level %d %s Aura When Equipped
0 : no value is displayed (like
1 : value is displayed first (like '+5 to strength')
2 : string is displayed first, then value (like 'strength +5')
Description string used when value is positive
Description string used when value is negative
Second display string (for per level attributes for example)
Display group. If all stats of a display group have the same stats, they will be displayed together.
Same as descfunc, but for display groups
Same as descval, but for display groups
Same as descstrpos, but for display groups
Same as descstrneg, but for display groups
Same as descstr2, but for display groups
End of line
One thing you should NEVER EVER do:
have op base and op stat1 be the same. The game crashes with no error message at all when trying to compile the .bin file. Most likely, the same happens when op base and op stat2 / 3 are the same.
EDIT 3, 4:
added info about descval, corrected info about descstr
NEVER make two stats have the same name. I posted what happens then here
Link to this article: Select all
[url=https://www.d2mods.info/forum/kb/viewarticle?a=353&sid=c52fb2b7a3dfb1615001bc8099a774d2]Knowledge Base - ItemStatCost.txt File Guide[/url]