class Item¶
-
class
Item
¶ -
GetEntireAppearance
()¶ Encodes an items appearance. Source: nwnx_funcs by Acaos
Return type: A string encoding the appearance
-
GetItemAppearance
(appearance_type, index)¶ Returns the appearance of an item
Parameters: - appearance_type (int) – ITEM_APPR_TYPE_*
- index (int) – ITEM_APPR_WEAPON_* or ITEM_APPR_ARMOR_*
-
RestoreAppearance
(appearance)¶ Restores an items appearance.
Parameters: - appearance (string) – An encoding from
Item:GetEntireAppearance()
- appearance (string) – An encoding from
-
SetAppearance
(index, value)¶ Set item appearance
Parameters: - index (int) – index
- value (int) – value
-
SetColor
(index, value)¶ Set item color
Parameters: - index (int) – index
- value (int) – value
-
GetACValue
()¶ Get the armor class of an item.
-
ComputeArmorClass
()¶ Compute armor class.
-
GetBaseArmorACBonus
()¶ Gets Armor’s Base AC bonus.
Note
Note this is currently hardcoded to the typical vanilla NWN values.
Return type: -1 if item is not armor.
-
Copy
([target, copy_vars]])¶ Duplicates an item.
Parameters: - target (
Object
) – Create the item within this object’s inventory. (Default:OBJECT_INVALID
) - copy_vars (boolean) – If true, local variables on item are copied. (Default:
false
)
- target (
-
CopyAndModify
(modtype, index, value, copy_vars)¶ Copies an item, making a single modification to it
Parameters: - modtype – Type of modification to make.
- index (int) – Index of the modification to make.
- value (int) – New value of the modified index
- copy_vars (boolean) – If true, local variables on item are copied. (Default:
false
)
-
GetBaseType
()¶ Get the base item type.
Return type: BASE_ITEM_INVALID if invalid item.
-
SetBaseType
(value)¶ Sets an items base type
Parameters: - value (int) – BASE_ITEM_*
-
GetGoldValue
()¶ Determines the value of an item in gold pieces.
-
SetGoldValue
(value)¶ Sets an items gold piece value when IDed Source: nwnx_funcs by Acaos
Parameters: - value (int) – New gold value.
-
GetStackSize
()¶ Get item’s stack size.
-
SetStackSize
(value)¶ Set item’s stack size.
Parameters: - value (int) – New stack size.
-
GetPossesor
()¶ Get item possessor.
-
AddItemProperty
(dur_type, ip, duration)¶ Add an itemproperty to an item
Parameters: - dur_type (int) – DURATION_TYPE_*
- ip (
Itemprop
) – Itemproperty to add. - duration (float) – Duration Duration in seconds in added temporarily. (Default: 0.0)
-
GetHasItemProperty
(ip_type)¶ Check whether an item has a given property.
Parameters: - ip_type (int) – ITEM_PROPERTY_*
-
ItemProperties
()¶ Iterator over items properties
-
RemoveItemProperty
(ip)¶ Removes an item property
Parameters: - ip (
Itemprop
) – Item property to remove.
- ip (
-
GetDroppable
()¶ Determines if an item can be dropped.
-
SetDroppable
(flag)¶ Set droppable flag.
Parameters: - flag (boolean) – New value.
-
GetIdentified
()¶ Determines whether an object has been identified.
-
GetInfiniteFlag
()¶ Gets if there is an infinite quantity of any item in a store.
-
SetIdentified
([is_ided])¶ Sets an item identified
Parameters: - is_ided (boolean) – (Default:
false
)
- is_ided (boolean) – (Default:
-
SetInfiniteFlag
([infinite])¶ Sets and items infinite quantity flag.
Parameters: - infinite (boolean) – (Defaut:
false
)
- infinite (boolean) – (Defaut:
-
GetCursedFlag
()¶ Get item cursed flag.
-
SetCursedFlag
(flag)¶ Set item cursed flag.
Parameters: - flag (boolean) – New flag.
-
GetWeight
()¶ Gets item weight.
-
SetWeight
(weight)¶ Sets item’s weight.
Parameters: - weight (int) – New weight.
-