PenUltima Online

It is currently Sat Aug 30, 2008 5:23 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: New NPC on death?
PostPosted: Sun Nov 04, 2007 4:24 pm 
Offline

Joined: Mon Feb 13, 2006 1:35 pm
Posts: 7
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 09, 2007 12:55 am 
Offline

Joined: Thu Feb 02, 2006 1:41 pm
Posts: 1120
Location: Southern Central USA
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:
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.

_________________
Sincerely,
Yukiko

I know you think you understand what you thought I said but what you heard is not exactly what I meant.

Titus 2:13


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 29, 2007 4:40 am 
Offline

Joined: Thu Feb 02, 2006 7:29 am
Posts: 90
Location: Livorno, Italy
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... :D

_________________
Gnafu
DRL freelance scripter :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl