https://github.com/shadowevil/d2slib-resurrected
Will post credits to original designer - Fixing for newest version of Resurrected, dropping all support for old as I am not interested.
https://github.com/shadowevil/d2slib-resurrected
Last synced: 10 months ago
JSON representation
Will post credits to original designer - Fixing for newest version of Resurrected, dropping all support for old as I am not interested.
- Host: GitHub
- URL: https://github.com/shadowevil/d2slib-resurrected
- Owner: shadowevil
- License: mit
- Created: 2022-12-28T06:30:24.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-28T06:30:28.000Z (over 3 years ago)
- Last Synced: 2025-08-29T06:22:59.319Z (10 months ago)
- Language: C#
- Size: 91.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### D2SLib
Simple C# library for reading and writing Diablo 2 saves. Supports version 1.10 through Diablo II: Resurrected (1.15). Supports reading both d2s (player saves) and d2i (shared stash) files.
### Usage
Use [Nuget](https://www.nuget.org/packages/D2SLib/) to add D2SLib to your project.
```
using D2SLib;
using D2SLib.Model.Save;
....
//read a save
D2S character = Core.ReadD2S(File.ReadAllBytes(@"Resources\D2S\1.15\DannyIsGreat.d2s"));
//outputs: DannyIsGreat
Console.WriteLine(character.Name);
//convert 1.10-1.114d save to d2r 1.15
character.Header.Version = 0x61;
//set all skills to have 20 points
character.ClassSkills.Skills.ForEach(skill => skill.Points = 20);
//add lvl 31 conviction arua to the first statlist on the first item in your chars inventory
character.PlayerItemList.Items[0].StatLists[0].Stats.Add(new ItemStat { Stat = "item_aura", Param = 123, Value = 31 });
//write save
File.WriteAllBytes(Environment.ExpandEnvironmentVariables($"%userprofile%/Saved Games/Diablo II Resurrected Tech Alpha/{character.Name}.d2s"), Core.WriteD2S(character));
```
How to seed the library with your own TXT files
```
TXT txt = new TXT();
txt.ItemStatCostTXT = ItemStatCostTXT.Read(@"ItemStatCost.txt");
txt.ItemsTXT.ArmorTXT = ArmorTXT.Read(@"Armor.txt");
txt.ItemsTXT.WeaponsTXT = WeaponsTXT.Read(@"Weapons.txt");
txt.ItemsTXT.MiscTXT = MiscTXT.Read(@"Misc.txt");
Core.TXT = txt;
D2S character = Core.ReadD2S(File.ReadAllBytes(@"DannyIsGreat.d2s"));
```
##### Useful Links:
* https://github.com/d07RiV/d07riv.github.io/blob/master/d2r.html (credits to d07riv for reversing the item code on D2R)
* https://github.com/nokka/d2s
* https://github.com/krisives/d2s-format
* http://paul.siramy.free.fr/d2ref/eng/
* http://user.xmission.com/~trevin/DiabloIIv1.09_File_Format.shtml
* https://github.com/nickshanks/Alkor
* https://github.com/HarpyWar/d2s-character-editor