Edit diablo ii bin file2/8/2024 I'll try and post a compiled version when I clean up some attachment space.ĭiablo_II_Simple_Name_Changer.Fix several bugs and extend some files based on the original v1.13c TXT. Refreash ( ) EndFunc Func Refreash ( ) $file = GUICtrlRead ( $txtFilePath ) if $file = "" then Return $filehandle = FileOpen ( $file, 4 ) $size = FileGetSize ( $file ) dim $byteA for $i = 0 to $size - 1 $byteA = FileRead ( $filehandle, 1 ) Next $name = "" for $i = 20 to 35 $name &= chr ( Dec ( Hex ( Binary ( $byteA ) ) ) ) Next GUICtrlSetData ( $txtCharName, $name ) EndFunc func FixCheckSum ( ) dim $checksum $byteA = 0x00 $byteA = 0x00 $byteA = 0x00 $byteA = 0x00 $boolCarry = 0 for $i = 0 to UBound ( $byteA ) - 1 $temp = Dec ( Hex ( Binary ( $byteA ) ) ) + $boolCarry $checksum = $checksum * 2 + $temp $checksum = $checksum * 2 if $checksum > 255 Then $checksum = $checksum + ( $checksum - Mod ( $checksum, 256 ) ) / 256 $checksum = Mod ( $checksum, 256 ) EndIf $checksum = $checksum * 2 if $checksum > 255 Then $checksum = $checksum + ( $checksum - Mod ( $checksum, 256 ) ) / 256 $checksum = Mod ( $checksum, 256 ) EndIf $checksum = $checksum * 2 if $checksum > 255 Then $checksum = $checksum + ( $checksum - Mod ( $checksum, 256 ) ) / 256 $checksum = Mod ( $checksum, 256 ) EndIf If $checksum > 255 Then $checksum = Mod ( $checksum, 256 ) EndIf if BitAND ( $checksum, 0x80 ) 0 Then $boolCarry = 1 Else $boolCarry = 0 EndIf Next $byteA = "0x" & Hex ( $checksum, 2 ) $byteA = "0x" & Hex ( $checksum, 2 ) $byteA = "0x" & Hex ( $checksum, 2 ) $byteA = "0x" & Hex ( $checksum, 2 ) EndFunc WriteFile ( ) MsgBox ( 0, "Done", "File Saved" ) EndFunc Func WriteFile ( ) $Path = GUICtrlRead ( $txtFilePath ) $Dir = StringMid ( $Path, 1, StringInStr ( $Path, "\", 0 ,- 1 ) ) $newName = GUICtrlRead ( $txtNewName ) $OutFile = FileOpen ( $Dir & $NewName & ".d2s", 18 ) for $i = 0 to UBound ( $byteA ) - 1 FileWrite ( $OutFile, $byteA ) Next FileClose ( $OutFile ) EndFunc func Close ( ) Exit EndFunc func Browse ( ) $Path = FileOpenDialog ( "Select Save File", , "Diablo II Save Files(*.d2s)" ) if $Path = "" then Return GUICtrlSetData ( $txtFilePath, $Path ) key or map files, so you have to do that manually if you want them" ) EndFunc func Apply ( ) $newName = GUICtrlRead ( $txtNewName ) if $newName = "" or StringLen ( $newName ) 16 Then MsgBox ( 0, "Error", "Invalid Name" ) Return EndIf for $i = 20 to 35 $byteA = Binary ( "0x" & Hex ( Asc ( StringMid ( $newName, $i - 19, 1 ) ), 2 ) ) Next It's quite entertaining for a refreashing Diablo II experiance, and it is the inspiration for this script.Įxpand collapse popup Opt ( "GuiOnEventMode", 1 ) GuiCreate ( "Diablo II - Simple Name Changer", 392, 323 ) GUISetOnEvent ( - 3, "Close" ) $txtFilePath = GuiCtrlCreateInput ( "", 90, 20, 200, 20 ) GuiCtrlCreateLabel ( "Current Name:", 10, 60, 70, 20 ) $txtCharName = GuiCtrlCreateInput ( "", 90, 60, 200, 20 ) GUICtrlSetState ( - 1, 128 ) GuiCtrlCreateLabel ( "File:", 40, 20, 40, 20 ) $btnBrowse = GuiCtrlCreateButton ( "Browse", 310, 20, 60, 20 ) GUICtrlSetOnEvent ( - 1, "Browse" ) $btnRefreash = GuiCtrlCreateButton ( "Refreash", 310, 60, 60, 20 ) GUICtrlSetOnEvent ( - 1, "Refreash" ) GuiCtrlCreateLabel ( "New Name", 10, 150, 60, 20 ) $txtNewName = GuiCtrlCreateInput ( "", 90, 150, 200, 20 ) $btnBrwose = GuiCtrlCreateButton ( "Apply", 310, 150, 60, 20 ) GUICtrlSetOnEvent ( - 1, "Apply" ) $btnClose = GuiCtrlCreateButton ( "Close", 300, 290, 90, 30 ) GUICtrlSetOnEvent ( - 3, "Close" ) $btnAbout = GuiCtrlCreateButton ( "About", 0, 290, 70, 30 ) GUICtrlSetOnEvent ( - 1, "About" ) Global $byteA GuiSetState ( ) While 1 Sleep ( 100 ) WEnd func About ( ) MsgBox ( 0, "Simple Name Changer V1.0 by Evilertoaster", "This is designed to rename a single player character for Daiblo II 1.10 and 1.11. d2s files) and don't try to do anything fancy.Īlso, as a side note, I would like to recomend the following mod to any Diablo II fans. This script only looks at the file header and only write to the name section.Īlso keep in mind there is no elaborate checking for errors, invalid files or other circumstancial use. As a result, they fail to work on save files for mod'ed versions of Diablo II. They provide anaylisis and automatic fixing of the save file, but for certian cases this is not ideal (namely, when using a MOD that has non-stnadard save files). It was written becuase most other utilities that can do name changes are 'too' functional. It is indended for use in Diablo II LOD 1.10 and 1.11. Select a save file, pick a new name, and hit apply. Here's a script to change your characters name in Diablo II.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |