SetItemCursedFlag

From NWN Lexicon
Jump to: navigation, search



SetItemCursedFlag(object, int)

Sets whether an item is cursed or not

void SetItemCursedFlag(
    object oItem,
    int nCursed
);

Parameters

oItem

Item to set cursed flag on

nCursed

TRUE or FALSE


Description

When cursed, items cannot be dropped.

This is the same as the flag as can be set in an items properties.



Remarks

This doesn't stop an item being removed from their inventory slots, but it cannot be dropped on the floor, pick-pocketed or sold.

Items which are cursed and which are in a placeable cannot be "dropped" by the placeable, so cannot be removed.

Inventory containers (IE: Bags of Holding and Boxes) act like new containers for the purposes of where items can be moved to or taken from with the exception that game engine can remove and equip cursed ammunition from container.


Version

1.62

Example

// When acquired, an item with the variable "CURSED" is set
// to TRUE on it, it will curse and plot the item.
void main()
{
    // Check what item was acquired
    object oItem = GetModuleItemAcquired();
    // Check the variable
    if(GetLocalInt(oItem, "CURSED") == TRUE)
    {
        // Set so it cannot be sold or removed from the inventory
        SetItemCursedFlag(oItem, TRUE);
        SetPlotFlag(oItem, TRUE);
    }
}

See Also

functions: 

GetItemCursedFlag



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