Divinity Banner
Topic Options
#79657 - 07/02/03 08:13 AM Reviving dead NPCs
Raze Offline


Registered: 03/10/03
Posts: 21274
Loc: Canada
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.

Warning
  • 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.


Procedure

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.

Tip: 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.
X = 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;
X = A0 18 ; Y= 10 1A ; map = 00


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.




Disclaimer

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;
X = 80 51 ; Y= 90 66 ; map = 01


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.




Top
#79658 - 07/05/03 01:12 AM Re: Reviving dead NPCs
Krull Offline
member

Registered: 06/15/03
Posts: 148
Loc: USA
Just curious but why would you need/want to revive an NPC like Iona's pet? to get more exp or something?
_________________________
BEAVERS AND DUCKS!!!

Top
#79659 - 07/05/03 01:51 AM Re: Reviving dead NPCs
Johnson Offline
veteran

Registered: 05/20/03
Posts: 1207
uh...that seems like alot of work just to revive someone...

Top
#79660 - 07/05/03 02:07 AM Re: Reviving dead NPCs
Raze Offline


Registered: 03/10/03
Posts: 21274
Loc: Canada
Quote:

Just curious but why would you need/want to revive an NPC like Iona's pet? to get more exp or something?




I was just playing. I teleported to Seth's location to see where he took off to after the escort quest, and found a whole stack of NPCs. Iona's pet was pretty much the only one who stuck out visibly from the group (due to his size), so was the easiest one to use in order to check if they were copies or originals. With the difference in format for Cyrion's data (which I discovered during this test), a more accurate experiment might have been to find the same elves in the dark forest, then teleport into the storage room to see if they were still there after the cut scene as you approach the talking tree. However, I wasn't curious enough about how the game uses that room to do another test.

Resurrect (and running/teleporting away so they turn hostile) can easily be used to repeatedly kill monsters for the experience. The usually hostile NPCs in the storage room do not react to you there and you can not attack them (you can talk to the elves, though). For non-quest related NPCs, the reviving part of the procedure has no practical applications.


Quote:

uh...that seems like alot of work just to revive someone...




Actually, it doesn't take very long once you are familiar with the procedure. Some people are a little obsessive when it comes to completing quests, so if a few minutes and a hex editor can fix a dead NPC, it would be worth it. For many cases, the effort might not be worth the experience/reward you would get for the completed quest.

Before the latest patch, a couple people killed either Joram and Otho (at least one of which is required for the lizard council member quest), or Goemoe (also required for that quest), thereby breaking the main plot line and making it impossible to finish the game. For games started before installing the patch, people could still run into this if they go on a killing spree. Several people have had NPCs go missing and been unable to find them after a careful search. this procedure might be able to re-set their position (again, it would depend on the quest whether it would be worth the effort to do so).

Top
#79661 - 04/11/04 09:46 AM Re: Reviving dead NPCs
Raze Offline


Registered: 03/10/03
Posts: 21274
Loc: Canada
With the latest release of Hackman (8.0), the freeware version has a fairly low limit of the file size it will handle (something like 200KB, IIRC).

Frhed is an open source program (though has not been updated in awhile), or check this list of freeware hex editors.

Top
#79662 - 04/15/04 09:49 AM Re: Reviving dead NPCs
Feng Offline
journeyman

Registered: 02/21/04
Posts: 95
Loc: England, Nottingham
well i wont be hexing mine again... i sumhow made about 6 of every elf in the Dark forest. I always screw stuff up when i edit or Hack. The only editor im any good with is the Warcraft 3 one
_________________________
"Dont you Feel Guilty after stealing from a hard working, honest merchant?"and the Cutpearse Replied "When i find one to steal from, ill let you know."

Top
#79663 - 10/29/07 04:30 AM Re: Reviving dead NPCs
Raze Offline


Registered: 03/10/03
Posts: 21274
Loc: Canada

Top
#363802 - 06/15/09 09:27 PM Re: Reviving dead NPCs [Re: Raze]
True Divine One Offline
stranger

Registered: 06/03/09
Posts: 9
I've been doing some experimenting and found out that the NPC storage room is actualy a teleportation room.In here you will find all NPC and items that you lost/sacrificed(the holy items and the Silver Breastplate)/have no need for them in the "normal" world.It's made so because the game crashed to blue screen of death(windows xp).Once you start a new character, the data is configured from a template in .../Divine Divinity/Run/main/startup or in some case startup.v2.

Got the info with the help of a friend and a computer engineer(friends father).

Top
#513098 - 07/08/14 01:36 PM Re: Reviving dead NPCs [Re: Raze]
Stormwolf Offline
stranger

Registered: 07/01/14
Posts: 8
Hmm, after saving a game there are no data.000 file in the save game folders. Am i missing something?

Top
#513234 - 07/08/14 03:28 PM Re: Reviving dead NPCs [Re: Stormwolf]
Raze Offline


Registered: 03/10/03
Posts: 21274
Loc: Canada

If you are referring to Divine Divinity, then there should be a data.000 file in the save folder. Divinity Original Sin does not use the same save format.

Top

Moderator:  Larian_QA, Lar_q, Lynn, Macbeth