Item

class ourdestiny.d2item(item_request_json, profile_object_in, character_object_in=None)

Bases: ourdestiny.common.d2displayproperties

The object form of an in-game item. This can be anything that can be equipped or put in your inventory - guns, armour, sparrows, subclasses, even bounties and quests.

Parameters:
  • item_request_json (dict) – The JSON data of the item obtained from the API
  • profile_object_in (ourdestiny.d2profile) – The object was used to create this item
  • character_object_in (ourdestiny.d2character) – The object of the character that owns this item if it has an owner
Variables:
  • description (string) – The description of the item
  • name (string) – The name of the item
  • attack (integer) – The value for the main stat of the item - normally attack
  • type (string) – The type of the item (hand cannon, auto rifle, rocket launcher…)
  • tier (string) – The tier of the item (Legendary, Rare, Common…)
  • quantity (integer) – The quantity of the item (normally 1 but can be more in the case of currency items)
  • icon_url (string) – The URL to the icon of the item (if it has one)
  • screenshot_url (string) – The URL of the in-game screenshot of the item normally used for backgrounds to items (if it has one)
  • lore (ourdestiny.d2lore) – The lore in the lore tab of the item (if it has one)
  • instance_id (string) – The unique ID for this item that tracks its instanced data
  • perks (list) – A list of dicts that contain the name, description, and URL of the icon for each perk, as well as boolean values for whether it is active and visible - empty when not instanced, fills when instanced
  • is_equipped (bool) – A value that denotes whether an item is currently equipped or not - defaults to false when not instanced
  • can_equip (bool) – A value that denotes whether an item can be equipped - differs from is_equipped in that it takes into account more complex requirements for equipping an item, such as level or exotics equipped
  • is_instanced_item (bool) – A value that denotes whether the current item is in its instanced form - meaning it has unique stats and is capable of being equipped among other things
  • stats (list) – A list of dicts that contain the names and values of each of the stats for this item - generic when not instanced, updates when instanced
  • owner_object (ourdestiny.d2character) – The object of the character that owns this object
  • profile_object (ourdestiny.d2profile) – The object of the profile that was used to create this object
  • item_hash (integer) – The hash value of this item for the database files
  • bucket_info (dict) – The information about what slot this item should fit in - taken directly from the API
become_instanced()

When called, allows an object to become instanced. This updates its can_equip, is_equipped, is_instanced, attack, stats and perk values.