This is a translation of a post by Barnabus
in the german forum, describing how to revive a dead NPC (using a hex editor to alter information stored in a file in the saved game folder). It is intended for cases where a quest relevant NPC is killed by enemies (such as Gareth in the barracks or Caroline in Ars Magicana), or by yourself using indirect means. The latest patch
adds protection for more of the essential NPCs, but minor quests may still be broken this way. If you kill an NPC directly and later revive them, they will remain hostile and attack you immediately.
Original post; Wiederbelebung von NPC´s (Hex-Hexereien - Teil 2)
Please read this post through before attempting, and make sure you follow the steps below carefully.
You will need a hex editor, such as the freeware program Hackman
- A mistake, typo or out-of-range value when editing the data file can cause the game to either crash to desktop or completely lock up, forcing a re-boot. Make a backup before hex editing anything.
- The data.000 file basically defines your character (stats, skills, experience points, class, gender, etc.) and keeps track of all NPC locations and status, in addition to storing your own location. Without a valid, working data.000 file, the saved game will be useless.
1) Save the game
under a new name
before attempting this, or make a copy of the saved game folder. It couldn't hurt to also make a backup of the data.000 file in the new saved/copied game folder.
Save the game with your character close to the dead NPC you wish to revive, to make it easier and faster to check the results of your hex editing.
2) Browse to the saved game folder you want to modify '..\Divine Divinity\Run\savegames\NameOfSave
', and open the data.000
file in a hex editor.
3) Search (ASCII mode) for the NPC's name (the example shown below is for Gareth). The name will appear multiple times; keep searching until you find the name followed by a number (ie Gareth69) without any other names, etc. just before it. There should only be a couple instances of the name followed by a number, with the correct one looking similar to the example screen shot below.
4) Now scroll upwards a bit, and look for the sequence 80 3F 00 00 80 3F 00 00 00 00
. For some NPCs in the Dark Forest, it may be E6 3F 66 66 66 3F 00 00 00 00
, but the 3F xx xx xx 3F
is the same for all NPCs. The hex value 3F
corresponds to the ASCII symbol ?
so it may be easier to spot two question marks on the ASCII side of the hex editor than looking for the hex values.
In Hackman, click on the arrow button at the top or bottom of the scroll bar to move up or down the file one 'page' at a time; don't try to drag the scroll bar or click below it, you will go past the spot you need. These values should within about a page above the NPC's name.
5) The bytes that need to be changed are found using this sequence of numbers for orientation. Counting from the last 3F
, the 7th, 17th and 18th bytes should be changed to 00
(see screen shot).
6) You can, and in some cases must, also change the NPC's position. Though there are minor differences, the procedure is described in the post Teleporting Anywhere, via hex editor
. The easiest way to do this is to stand where you want the NPC to be before you save, then find your coordinates and enter them for the NPC. Make sure you check the map value as well, or the NPC could end up out of bounds. In Hackman, the 'new npc' term should be within a couple pages above the NPC's name.
Some NPCs go to what amounts to an NPC storage room
(54KB) when they die, which also contains various other NPCs (Sir Markham, Cosmo, the ghost of the duke, etc). Anyone in this room will have the location coordinates below, in which case you must
change their position when you revive them.
= C0 0E ; Y
= 00 D0 (or sometimes 10 D0 ) ; map
= 00 ... NPC storage room
You can use this to bring Seth back to Aleroth's gate after you have completed the Escort for the Healers
quest (no need for step 5, unless you killed him). Coordinates you can use are;
= A0 18 ; Y
= 10 1A ; map
7) (Optional) If you would like to heal the NPC, or at least add a few health points, search just above their name for the sequence xx FF FF FF
. The xx
term is the number of hit points (a hex value of '64' will give the NPC 100 hit points), while the FF FF FF
needs to be replaced by 00 00 00
. This is only necessary if the NPC was killed in a fight, not if they were killed by the ghost in the Dark Forest. Even if they were killed in a fight, the game does not mind reviving someone with zero (or even negative) hit points, though this would make them very easy to kill again if there were still hostile enemies in the vicinity.
If you kill an NPC using Poison Cloud (indirect attack, they do not turn hostile), wait until the spell duration is up before saving and reviving them (assuming you would ever want to kill someone and immediately revive them). For many NPCs you can see when this occurs, but Seth's body (for example) just disappears. If you save before the poison wears off (being dead does not effect this), they will be poisoned when you revive them and will need to be healed so they do not die again right away.
8) After making the required changes, save and close the file. You do not have to shut down the hex editor if you want to play around with this (or just confirm the changes worked), but you should close
the file so the editor and game are not trying to access the file at the same time.
9) Start Divinity (if required) and load the game. If all went according to plan, the NPC is no longer dead, and you should be able to talk, trade and complete quests as if they had not died.
This procedure will not fully work for Corinna if you gave her the fake talking tree branch, since there is information about the summoning quest stored in the other files, and in other parts of the data.000 file. However, if you just want to bring her back as a trading partner (for the silver charms and occasional spell books she sells), it will work for that (search for 'Corinna AlMeara466', the second occurance should be the correct one to edit). This can also be used if you failed to save her from the first demon she tried to summon.
After being revived, she does not respond if you try to talk to her, but if you click on her in combat mode, she will tell you not to menace everyone you meet. You can then click on the trade icon, but make sure you exit the dialog by lowering your weapon, not attacking.
I had traded with her quite a bit in the game I tested this with, in addition to saving her from her first summoning experiment, so she had an opinion of 100 (Admiring). Several 'attacks' and weapon sheathing later, her opinion had not dropped.
You should also change her location, so you do not need to go downstairs to trade;
= 80 51 ; Y
= 90 66 ; map
Some NPCs that show up in several places (such as the Black Ring members) have their information stored in a different format, so this procedure will not work (either to revive or to relocate).
It is possible for an NPC, such as Shrimpo, to have two different numbers after their name in the data file, though at least in Shrimpo's case, one instance is in the general format described above, and his location can be changed (I didn't try killing and reviving him).
The coordinates for Iona's pet Cyrion are listed as being in the NPC storage room, even when he is not (obviously, the game is using a slightly different format for his location). I saved the game with Cyrion alive, dead and Resurrected in his cave, then teleported to the storage room, where Cyrion could clearly be seen in the NPC pile (only Sir Markham and the elves seem to wander around after you get there). After casting Aura of Command on him and teleporting to the room, the only instance of Cyrion was the one following my character.
Basically, this procedure should work for many of the cases where you would want to use it, but there are exceptions.