Jump to content

Home

A question about the On-Death field of a creature's .utc


Exile007

Recommended Posts

Hello there everyone. :)

 

I've been trying to script it so that when an npc dies, it disappears. Now I know I could use the userdefine method to do this, but I want the PC to be able to still gain experience from killing the enemies, even if they disappear.

 

So, I attatched this script to the On-Death portion of the creature's .utc

 

void main()
{
DestroyObject(OBJECT_SELF);
}

 

This works fine for the most part, however the NPC will still in essence drop loot. Considering that the NPC just disappeared it makes no sense for loot to be dropped. If anyone could point me out in the right direction I would appreciate it. :)

Link to comment
Share on other sites

This works fine for the most part, however the NPC will still in essence drop loot. Considering that the NPC just disappeared it makes no sense for loot to be dropped. If anyone could point me out in the right direction I would appreciate it. :)

 

The most straightforward way of doing that would be to make sure the NPCs have no loot to drop. Set all their equipped items as undroppable and give them a custom OnSpawn script that does not give them any random loot (remove the PlaceCritterTreasure() function call if this is for TSL).

Link to comment
Share on other sites

The most straightforward way of doing that would be to make sure the NPCs have no loot to drop. Set all their equipped items as undroppable and give them a custom OnSpawn script that does not give them any random loot (remove the PlaceCritterTreasure() function call if this is for TSL).

 

Ah, thanks stoffe. I never would have guessed that loot was generated via spawn-in scripts. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...