SetDroppableFlag
From NWN Lexicon
Contents |
[edit] SetDroppableFlag(object, int)
Marks an item as droppable or undroppable.
void SetDroppableFlag( object oItem, int bDroppable );
[edit] Parameters
oItem
Item to set the droppable flag of.
bDroppable
Determines if the item is droppable (TRUE if it can be dropped, FALSE otherwise).
[edit] Description
Sets the flag of an item as a droppable item or an undroppable item.
[edit] Remarks
Useful function. For instance, if you have a bunch of enemies with a certain item, and you only want some of them to drop that, but want it determined randomly, you can call SetDroppableFlag either OnSpawn or OnDeath of those creatures with a randomness factor determining if the item should be droppable or not.
[edit] Version
1.30
[edit] Example
//A bunch of creatures have items tagged "some_boots". You //want, statistically, 25% of them to drop those boots //when slain. Goes either OnDeath or OnSpawn void main() { object oItem=GetItemPossessedBy(OBJECT_SELF, "some_boots"); //25% chance of being droppable int bDroppable=d100()>75; SetDroppableFlag(oItem, bDroppable); }
[edit] See Also
functions: |
author: Charles Feduke, editor: Lilac Soul