Posted: Sun Nov 04, 2007 8:24 pm Post subject: New NPC on death?
Once an NPC dies, say, a zombie, how could you make it turn into a skeleton?
I know it's a bit of a novice question, I apologize for being a noob
It would be cool if the zombie had a random chance of either just dying or turning into a skeleton, but beggars can't be choosers.
Author
Message
Yukiko
Joined: 02 Feb 2006 Posts: 1094 Location: Southern Central USA
Posted: Fri Nov 09, 2007 4:55 am Post subject:
Under POL 0.95 and converted 0.95 to 0.97 Distro death.src in \pol\scripts\misc is the script that fires when an NPC dies.
It's fairly easy to spawn a skeleton at the dead zombie's location.
Assuming you want a corpse of the zombie to remain on the ground and simply spawn a skeleton you can add the following code just before the endprogram statement in death.src
I am pretty sure that will work fine. If you are running pre-0.96 POL you will have to remove the 'corpse.realm' parameter from the CreateNPCFromTemplate function call.
Author
Message
Gnafu
Joined: 02 Feb 2006 Posts: 88 Location: Livorno, Italy
Posted: Thu Nov 29, 2007 8:40 am Post subject:
I'm using a cprop on the NPC
Example
Zombie has the "spawnondead" cprop set to "scheleton"
the death script will create another npc using the template "scheleton".
In this way you can modify the npctemplate to spawn while playing simply setting the cprop without recompiling every time.
It's funny to see players becoming mad when dead rats starts to raise scheletons...