Aller au contenu

Photo

Get the PC's last killer


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Sir Adril

Sir Adril
  • Members
  • 63 messages
Hi there, I'm new to the forums, and I need help for a module I'm trying to work on.

To help you with helping me find a solution, in basic terms, I want:
  • If PC killed by Guard, then respawn in prison
  • Else respawn as normal.
Based on my last four days of muddling around trying to figure it out, I suspect what I'll need is to set an integer when the PC is killed by the guard, then reset it when the PC is respawned in the prison cell.

I can find a function that lets me find out who last killed an NPC -
GetLastKiller, but I can't seem to find something that will perform a
similar function to find out who last killed the PC. Am I being dense
and missing it? Or doesn't this function exist?

Thanks so much to anyone who puts the time and effort into reading this, and more so for anyone who can help me find a viable solution.

#2
Lovelamb

Lovelamb
  • Members
  • 38 messages
Does GetLastDamager() work, if the PC is dead?

I have special death scenarios in my modules, but I never directly check who the killer was. For example, I check if the NPC is alive and hostile and both PC and NPC in the same set of areas.

#3
Highv Priest

Highv Priest
  • Members
  • 93 messages
http://www.nwnlexico...astHostileActor

GetLastHostileActor is pretty good at returning killers for PCs. The ONE exception is you need to specify otherwise for spells or the spellcaster who killed the PC might not be the one flagged as the killer.(there is enough of a delay that another creature might get a hit in when the PC is already instantly dying by an implosion for an example.)

#4
Sir Adril

Sir Adril
  • Members
  • 63 messages
Thanks very much guys. In the end, I decided on GetLastDamager. You two have just cracked one of the critical parts of script I needed to get my module to work the way I wanted. I'll have to playtest it a bit further, but I think that did the trick.