SetItemCursedFlag

From NWN Lexicon



Contents

[edit] SetItemCursedFlag(object, int)

Sets whether an item is cursed or not

void SetItemCursedFlag(
    object oItem,
    int nCursed
);

[edit] Parameters

oItem

Item to set cursed flag on

nCursed

TRUE or FALSE


[edit] Description

When cursed, items cannot be dropped.

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



[edit] Remarks

This doesn't stop an item being removed from thier inventory slots, but it cannot be dropped on the floor, pickpocketed 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.


[edit] Version

1.62

[edit] Example

// When aquired, 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 aquired
    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);
    }
}

[edit] See Also

functions: 

GetItemCursedFlag



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

Personal tools
Categories