CGItem_C::GetRepairCost
function · objectlayer · primitive
- Address
0x5da330· 450 bytes, up to0x5da4f1- Meaning
- Returns an item's repair cost from durability, DurabilityCosts and DurabilityQuality, at least 1
- Confidence
- verified, proof one
- Finding
- objectlayer/items#repair-cost
- Test
objectlayer::item_randprop_delta_difftest
Finding: Repair cost in objectlayer: items
The repair cost of a damaged item is the missing durability times a quality multiplier times a
per-subclass cost, rounded half away from zero, at least 1. Only weapons (class 2, subclasses 0 to
21) and armour (class 4, subclasses 0 to 8) cost anything; a wrapped item, one without maximum
durability, or one at full durability costs 0. A DurabilityCosts row is 30 dwords: the id, 21
weapon costs and 8 armour costs. So weapon subclass 21 reads armour column 0, and armour subclass 8
reads past the row, the next row's id.
The derivation is in the doc.
Callers 2
Callees 4
- __ftol crt
- DBCache_ItemStats_C_int_HASHKEY_INT_::GetRecord dbcache
- GetItemClass objectlayer
- GetItemSubClass objectlayer
Calls and jumps by a bare address, from tables/calls.tsv.