fix item level require and properties

This commit is contained in:
vietdungdev
2026-05-22 22:35:24 +07:00
parent 450fccb5e9
commit 17ced44504

View File

@@ -144,9 +144,6 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary
UniqueSetID: txtUniqueSet,
}
// Set item properties
setProperties(itm, uint32(flags))
// Read rare affixes
rarePrefix := int16(ReadUIntFromBuffer(unitDataBuffer, 0x42, Uint16))
rareSuffix := int16(ReadUIntFromBuffer(unitDataBuffer, 0x44, Uint16))
@@ -378,6 +375,9 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary
continue
}
// Set item properties
setProperties(itm, uint32(flags))
// Read item stats
statsListExPtr := uintptr(ReadUIntFromBuffer(itemDataBuffer, 0x88, Uint64))
itm.BaseStats, itm.Stats = gd.getItemStats(statsListExPtr)
@@ -499,8 +499,9 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, merc OwnMercenary
maxReq := calculateItemLevelReq(itm, baseDesc)
// Check magic/rare affixes
//|| itm.Quality == item.QualityRare sai voi rare item
if itm.Identified && (itm.Quality == item.QualityMagic || itm.Quality == item.QualityCrafted) {
//itm.Quality == item.QualityMagic ||
//itm.Quality == item.QualityRare ||
if itm.Identified && (itm.Quality == item.QualityCrafted) {
maxReq = updateMaxReqFromAffixes(maxReq, itm.Affixes)
}
@@ -653,7 +654,7 @@ func setProperties(item *data.Item, flags uint32) {
item.IsEar = true
}
if 0x2000&flags != 0 {
item.InTradeOrStoreScreen = true // If item is sold to vendor or placed in trade with another player
item.InTradeOrStoreScreen = item.Owner == 0 // If item is sold to vendor or placed in trade with another player
}
if 0x800&flags != 0 {
item.HasSockets = true