Difference between revisions of "EquipItem"
(Generated by Sunjammer's Dragon Age Script Paser) |
|||
Line 1: | Line 1: | ||
− | |||
{{dafunction | {{dafunction | ||
|name=EquipItem | |name=EquipItem | ||
Line 9: | Line 8: | ||
|param2type=object | |param2type=object | ||
|param2name=oItem | |param2name=oItem | ||
− | |param2desc= | + | |param2desc=The item to be equipped. |
|param2default= | |param2default= | ||
|param3type=int | |param3type=int | ||
Line 27: | Line 26: | ||
== Description == | == Description == | ||
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. --> | <!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. --> | ||
− | Equips an item from the inventory into the equiped slots. | + | Equips an item from the inventory into the equiped slots. If no equipment slot is given, the item will be equipped where it best fits. If the equip slot is in the weapon set it will be equipped in the weapon set number that is given. If no weapon set number is given the active weapon set will be used. If an incorrect slot is given or an invalid object is given the function will return 0. |
− | If no equipment slot is given, the item will be equipped where it | + | |
− | best fits. If the equip slot is in the weapon set it will be equipped | + | |
− | in the weapon set number that is given. If no weapon set number is given | + | |
− | the active weapon set will be used. | + | |
− | If an incorrect slot is given or an invalid object is given | + | |
− | the function will return 0. | + | |
− | + | == Remarks == | |
<!-- This section contains additional comments, observations and known issues. --> | <!-- This section contains additional comments, observations and known issues. --> | ||
+ | There is a bug if the item is ITEM_TYPE_AMMO (missing constant, value returned by [[GetItemType]] is 7) and no equipment slot is specified. The ammo fails to equip. If the script also equips a shield, the shield only appears on the inventory screen paper doll, not in game, until weapon sets are swapped in and out. The workaround is to specify INVENTORY_SLOT_RANGEDAMMO and a weapon set when equipping ammo. | ||
<!-- == Examples == --> | <!-- == Examples == --> |
Latest revision as of 16:58, 29 December 2010
Equips an item on a creature
object oObject,
object oItem,
int nEquipSlot = INVENTORY_SLOT_INVALID,
int nWeaponSet = INVALID_WEAPON_SET
);
- Parameters:
- oObject
- The object to have its weapon set switched
- oItem
- The item to be equipped.
- nEquipSlot
- The optinal equip slot number. Use the INVENTORY_SLOT constants to specify a particular slot
- nWeaponSet
- The optinal weapon set number, it can be 0 or 1
- Returns:
- [Undocumented]
- Source:
- script.ldf
Description
Equips an item from the inventory into the equiped slots. If no equipment slot is given, the item will be equipped where it best fits. If the equip slot is in the weapon set it will be equipped in the weapon set number that is given. If no weapon set number is given the active weapon set will be used. If an incorrect slot is given or an invalid object is given the function will return 0.
Remarks
There is a bug if the item is ITEM_TYPE_AMMO (missing constant, value returned by GetItemType is 7) and no equipment slot is specified. The ammo fails to equip. If the script also equips a shield, the shield only appears on the inventory screen paper doll, not in game, until weapon sets are swapped in and out. The workaround is to specify INVENTORY_SLOT_RANGEDAMMO and a weapon set when equipping ammo.