I modified my script above as part of it was uneeded.
If you look at the npc .utc file, you should see a field called OnDeath. This is where you have to attach your script so it is fired when the npc dies.
You will find more on Creature events and USerDefined events here:
http://nwn.bioware.com/forums/viewcodepost.html?post=762559)
http://nwn.bioware.com/forums/viewcodepost.html?post=762682)
(It's for nwn but it applies to Kotor as well)
This part: AssignCommand((GetObjectByTag("my_npc_tag")) assigns a command to your other npc when the master dies. Replace my_npc_tag by the apprentice's tag.
Then this part: ActionStartConversation(GetFirstPC(), "my_dlg", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE));
Tells the npc to start conversation with the pc: ActionStartConversation(GetFirstPC(),
Tells thew npc which .dlg to use: "my_dlg" (replacemy_dlg with the resref of the .dlg file you want to use.
FALSE indicates that it is not a private converstation.
CONVERSATION_TYPE_CINEMATIC: the type of conversation, the other choice being CONVERSATION_TYPE_COMPUTER which gives you the computer interface.
and finally TRUE: since you mentioned that it was for use after a battle, this will start the conversation "without requiring to close the distance between the two object in dialog".
Look at nwscript.nss for more details.