SetItemCharges
Contents |
[edit] SetItemCharges(object, int)
Sets the number of charges left on a given item.
void SetItemCharges( object oItem, int nCharges );
[edit] Parameters
oItem
Item to set the number of charges on.
nCharges
Number of charges to set (0 to destroy).
[edit] Description
Sets the number of charges left on a given item. If nCharges is less than 0, the number of charges will be set to 0 (and the item is destroyed). If a value greater than the maximum number of charges that an item of its type can hold is passed, then the number of charges will be set to the item's maximum. If the number of charges ever reaches 0, the item is automatically destroyed.
[edit] Remarks
This function also works on items that donât normally have charges. You can give such an item 10 charges, and that will show up in its info screen when examining it. Setting item charges to 0 also destroys items that donât normally have charges.
If oItem isnât a valid item, nothing happens.
[edit] Version
1.30
[edit] See Also
author: Charles Feduke, editor: Lilac Soul