SetLootable(object, int)
From NWN Lexicon
Jump to navigationJump to search
Sets whether a creature leaves a lootable corpse upon death
void SetLootable(
object oCreature,
int bLootable
);
Parameters
- oCreature
- NPC to set as lootable or not
- bLootable
- TRUE or FALSE
Description
Sets the lootable state of a *living* NPC creature.
This function will *not* work on players or dead creatures.
Remarks
This corresponds to the "leaves lootable corpse" NPC property (under advanced in the NPC's properties).
Only NPCs can be lootable, and their lootable state must be set BEFORE they die.
Simply calling SetLootable doesn't appear to be sufficient to have the NPC leave a lootable corpse. The corpse left behind isn't selectable. To make a corpse lootable, add the two lines of code in the example below to the end of the NPC's OnSpawn script.
Example
SetIsDestroyable(TRUE, FALSE, TRUE);
SetLootable(OBJECT_SELF, TRUE);
See Also
| functions: |
author: Lilac Soul