CopyItemAndModify(object, int, int, int, int)
Copies an item, making a single modification to it
object CopyItemAndModify( object oItem, int nType, int nIndex, int nNewValue, int bCopyVars = FALSE );
Parameters
oItem
Item to copy and modify
nType
Type of modification to make
nIndex
Index of the modification to make
nNewValue
New value of the modified index
bCopyVars
If TRUE, all local variables are copied to the new weapon (Default: FALSE)
Description
Creates a new copy of an item, while making a single change to the appearance of the item.
Helmet models and simple items ignore iIndex.
Legal combinations:
iType: ITEM_APPR_TYPE_SIMPLE_MODEL
iIndex: [Ignored]
iNewValue: Model #
iType: ITEM_APPR_TYPE_WEAPON_COLOR
iIndex: ITEM_APPR_WEAPON_COLOR_*
iNewValue: 1-4
iType: ITEM_APPR_TYPE_WEAPON_MODEL
iIndex: ITEM_APPR_WEAPON_MODEL_*
iNewValue: Model #
iType: ITEM_APPR_TYPE_ARMOR_MODEL
iIndex: ITEM_APPR_ARMOR_MODEL_*
iNewValue: Model #
iType: ITEM_APPR_TYPE_ARMOR_COLOR
iIndex: ITEM_APPR_ARMOR_COLOR_*
iNewValue: 0-63
Remarks
Returns the copied object.
Note that the original item isn't destroyed by this function. You'll have to destroy it manually to really make it seem like the item is being modified.
Version
1.61
See Also
functions: | CopyItem | GetItemAppearance | IPDyeArmor |
categories: | Item Creation Functions |
constants: | ITEM_APPR_* Constants |
author: Lilac Soul