Skip to content

Commit

Permalink
add map id, seed edit
Browse files Browse the repository at this point in the history
  • Loading branch information
pairofdocs committed Sep 18, 2021
1 parent ef7967e commit 6e51395
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ This is the quest edit **enabled**:
511, 00 00
```

This is the Map ID, Seed edit **enabled**:
```
# set the char seed to `1337`
171, 1337, decimal
```


## Build GUI
`pip install wxpython`
`pip install pyinstaller`
`pyinstaller d2s_edit.py --onefile -w`


## Credits and Tools
- d2s save file format, https://user.xmission.com/~trevin/DiabloIIv1.09_File_Format.shtml
Expand Down
Binary file modified d2s_edit.exe
Binary file not shown.
1 change: 0 additions & 1 deletion d2s_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def OnOpen(self, event):
except Exception as e:
wx.LogError(f"Error: {e}")



app = wx.App()
Mywin(None,'D2S Savefile Edit')
Expand Down
9 changes: 5 additions & 4 deletions edit_and_recalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ def open_and_edit(filename):
# skip comments and blank lines and apply hex edits/patches
for line in [l for l in lines if l.strip() and l[0] != '#']:
# print(line)

address = int(line.split(',')[0])
hexstr_list = line.split(',')[1].strip().split()

if len(line.split(',')) > 2: # decimal. convert to little endian hex e.g. 333deci -> 4d 01 00 00
hexstr_list = int(line.split(',')[1].strip()).to_bytes(4, 'little').hex(' ').split()
else: # hex
hexstr_list = line.split(',')[1].strip().split()

# edit bytesarray # orig 0:2 int85, 170 -> (b'U\xaa') -> 55aa
for i in range(len(hexstr_list)):
bytarr[address + i] = int(hexstr_list[i], 16)
Expand All @@ -48,7 +50,6 @@ def open_and_edit(filename):
f.write(fix_checksum(bytarr))



if __name__ == "__main__":
filename = glob.glob('*.d2s')[0]
open_and_edit(filename)
Expand Down
13 changes: 3 additions & 10 deletions patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
#591, 00 00


### Char Map ID, Seed -----------------------------------------------------------
171, 333, decimal


### Char Stats ------------------------------------------------------------------

Expand All @@ -58,13 +61,3 @@

# change mana to 666
# offset 767. 9 bit encoding?



### Credits and Tools -----------------------------------------------------------

# d2s save file format, https://user.xmission.com/~trevin/DiabloIIv1.09_File_Format.shtml
# d2s file format https://github.com/krisives/d2s-format
# Themperor on discord for the RecalcCRC.exe tool
# d2s converter, TY Riv, https://d07riv.github.io/d2r.html
# d2s converter, TY Dschu, https://dschu012.github.io/d2s/

0 comments on commit 6e51395

Please sign in to comment.