IPGetModifiedWeapon(object, int, int, int)
Returns a copy of a weapon with the appearance of one weapon part modified.
object IPGetModifiedWeapon( object oWeapon, int nPart, int nMode, int bDestroyOldOnSuccess );
Parameters
oWeapon
Weapon acting as blueprint for a single modification.
nPart
ITEM_APPR_WEAPON_MODEL_* Weapon part for which the appearance type is modified.
nMode
X2_IP_WEAPONTYPE_* Defines how the new appearance type of the weapon part is to be determined.
bDestroyOldOnSuccess
Destroys the blueprint object on successful modification.
Description
This function determines the current appearance for a specified weapon part (nPart) of oWeapon and creates a copy of oWeapon with a
modified appearance for the specified weapon part.
If the modified copy is created successfully, the modified copy is returned. Otherwise the original blueprint (oWeapon) is returned.
If bDestroyOldOnSuccess is TRUE, the original weapon blueprint (oWeapon) will be destroyed on success.
The value of nPart determines the weapon part number, for which the appearance will be modified. nPart can take on any of the following values:
- ITEM_APPR_WEAPON_MODEL_BOTTOM
- ITEM_APPR_WEAPON_MODEL_MIDDLE
- ITEM_APPR_WEAPON_MODEL_TOP
Depending on the value of nMode, the new appearance of the specified weapon part will be set to either the next / previous
appearance type of the weapon part (relative to its current appearance) or to a random appearance, drawn from the
full list of appearance types for the specified weapon part.
nMode can be any of the following:
- X2_IP_WEAPONTYPE_NEXT returns the next appearance type
- X2_IP_WEAPONTYPE_PREV returns the previous appearance type
- X2_IP_WEAPONTYPE_RANDOM returns a random appearance type
Remarks
This function eventually calls CopyItemAndModify.
This is an internal function. See the note near the top of #include index for more details.
Requirements
#include "x2_inc_itemprop"
Version
1.61
See Also
author: motu99, editor: Mistress