PDA

View Full Version : A question about the On-Death field of a creature's .utc


Exile007
06-29-2008, 07:34 PM
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. :)

e-varmint
06-29-2008, 09:14 PM
It may work if you uncheck the "Disarmable" box in the "Advanced" tab of the .utc file.

Exile007
06-29-2008, 09:19 PM
Thanks, I'll test that out now. :)

stoffe
06-30-2008, 07:56 AM
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).

Exile007
06-30-2008, 12:19 PM
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. :)