SetStolenFlag

From NWN Lexicon



Contents

[edit] SetStolenFlag(object, int)

Set whether the item is stolen

void SetStolenFlag(
    object oItem,
    int nStolenFlag
);

[edit] Parameters

oItem

Item to set flag on

nStolenFlag

TRUE or FALSE


[edit] Description

Sets whether this item is 'stolen' or not.

The stolen flag means only certain stores (with "Buys Stolen Goods" ticked) will buy the item, normally at a much lower amount.



[edit] Remarks

The stolen flag can be retrieved with GetStolenFlag().

The stolen flag is set automatically on anything that is pickpocketed, and custom-made traps made with the Craft Trap skill are also set as stolen.


[edit] Version

1.62

[edit] Example

// Add to OnDisturbed for a chest.
// Any item taken from this chest is stolen! Thieves beware...
void main()
{
    // Was an item taken or added?
    if(GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_REMOVED)
    {
        // Get item taken
        object oStolen = GetInventoryDisturbItem();
 
        // Check if the item is valid (or not...somehow)
        if(GetIsObjectValid(oStolen))
        {
            // Set it to stolen, they won't sell this easily!
            SetStolenFlag(oStolen, TRUE);
        }
    }
}

[edit] See Also

functions: 

GetStolenFlag



 author: Lilac Soul, editor: Jasperre, additional contributor(s): Jasperre
 

Personal tools
Categories