squeek502 / d2itemreader Goto Github PK
View Code? Open in Web Editor NEWC library for parsing items in Diablo II character/stash files
Home Page: https://squeek502.github.io/d2itemreader/
License: The Unlicense
C library for parsing items in Diablo II character/stash files
Home Page: https://squeek502.github.io/d2itemreader/
License: The Unlicense
the D2 item format as described here:
https://squeek502.github.io/d2itemreader/formats/d2.html#item-list-data-format
reserves a 4 bit wide value (possible values range from 0 to 15) for the X coordinate, and a 3 bit wide value (possible values range from 0 to 7) for the Y coordinate. This representation is not sufficient to place the item in the PlugY stash, which has a page size of 10 by 10.
Conveniently, after the Y coordinate is a bit labeled unknown. After checking my limited set of test data, it seems to me that PlugY uses this unknown bit to extend the Y coordinate to a 4 bit field.
It seems tempting to assume that the item format reserves 4 bit for each X and Y coordinate, or are there test files that contradict this assumption?
See nokka/d2s#5
The set bits correspond with how many items of that set need to be worn to get that bonus, and also with the values of the
aprop
fields in SetItems.txt.If the bits are numbered 54321:
- If bit 1 is set, then it requires >= 2 items worn
- If bit 2 is set, then it requires >= 3 items worn
- If bit 3 is set, then it requires >= 4 items worn
- If bit 4 is set, then it requires >= 5 items worn
- If bit 5 is set, then it requires >= 6 items worn
Examples:
M'avina's Belt
- Set bonuses flag: 4 (00100)
- SetItems.txt only has
aprop3
field set- Only gets the bonus when >= 4 items are worn
IK Armor
- Set bonuses flag: 31 (11111)
- SetItems.txt has
aprop1
-aprop5
fields set- Get a new bonus each additional item that is worn
Trang's Armor
- Set bonuses flag: 10 (01010)
- SetItems.txt has
aprop2
andaprop4
fields set- Only gets a new bonus when >= 3 items are worn and then another at >= 5 worn
AFAIK this is the only relevant change:
D2_MAX_STASH_PAGE_NAME_STRLEN
got upped to 20 (from 15)For example, "Hit Causes Monster to Flee" (id 112) has a "Save Add" column with value -1. Need to check if this is truly a negative value or if -1 denotes something else. Either way, ItemStatCost is parsed by d2itemreader assuming unsigned integers, so there is a bug here somewhere (-1 becomes 65535).
Hi @squeek502
Please could you help me. I couldn't find another way to contact you so i'm opening an issue.
I'm looking for a way of restoring my plugy shared stash file. It got corrupted when plugy didnt save properly.
I'm trying to read my .sss file and see if i can restore it. Is this possible? Do you know how I could do it?
I'm busy looking at the plugy source code and found your repo which looks promising on how to read a .sss file.
When i try to use the corrupted .sss file the game gives error 9 "Unable to enter game. Bad header"
When I only try to use the bad character i get "Unable to enter game. Bad character version"
Please find the attached .sss file. I haven't figured out how to use the d2itemreader yet.
save_files.ZIP
// Harry
One thing that the current fuzz testing doesn't test for is proper handling of out-of-memory errors when allocating/reallocating memory. Could do something like https://stackoverflow.com/questions/21878083/how-to-create-random-memory-allocation-failure to do some fuzz testing with random memory failures to make sure we're properly handling those cases.
No idea how to install or Build .exe
Not sure that the library handles signed values properly, need to do some specific testing with negative values of item stat parameters.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.