Hi all. I just want to know/clarify what the thing that Lilac's says is when I create an OnDeath script with it.
If you choose to treat the PC as the killer, the script will forget which associate landed the killing blow, instead acting as if the PC landed it. If you choose to keep the associate as the killer, then that associate will be treated no differently than any other NPC (including having the script abort for lack of a PC, if you chose that option).
If I choose "treat the PC as the killer", the script becomes.
// Get the creature who triggered this event.
object oPC = GetLastKiller();
// We are really interested in the ultimate master of the killer.
while ( GetMaster(oPC) != OBJECT_INVALID )
oPC = GetMaster(oPC);
So here's the main question.
If I leave a script like
object oPC = GetLastKiller();
Without the second part... what happens then if a companion makes the killing? Is this non important in NWN2, or... in general, how should an OnDeath start in order to know that it will fire in any case?
P.S Any case of course means not a random creature killing the NPC, but the party
.
I ask because I have quite some instances where the journal gets updated through a kill, and I want to be certain that it will always do. Thanks a lot! As always
.





Retour en haut







