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 thier inventory slots, but it cannot be dropped on the floor.

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.

Note: It can still be sold! Setting the plot flag on the item is a good idea. 1.63 is meant to fix this.


Version

1.62

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);
    }
}

See Also

functions: GetItemCursedFlag
categories: Miscellaneous Functions


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