Page 1 of 1
New NPC on death?
Posted: Sun Nov 04, 2007 4:24 pm
by Havoc
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.
Posted: Fri Nov 09, 2007 12:55 am
by Yukiko
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
Code: Select all
if(GetObjProperty(corpse, "npctemplate") == "zombie")
CreateNPCFromTemplate("skeleton", corpse.x, corpse.y, corpse.z, 0, corpse.realm);
endif
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.
Posted: Thu Nov 29, 2007 4:40 am
by Gnafu
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...
