# RPG::Item

## Superclass

* [Object](https://enls.gitbook.io/rgss-reference-manual/standard-library/built-in-classes/object)

## Attributes

### id

The item ID.

### name

The item name.

### icon\_name

The item's icon graphic file name.

### description

The item description.

### scope

Scope of the item's effects (0: none, 1: one enemy, 2: all enemies, 3: one ally, 4: all allies, 5: 1 ally--HP 0, 6: all allies--HP 0, 7: the user).

### occasion

When the item may be used (0: always, 1: only in battle, 2: only from the menu, 3: never).

### animation1\_id

The animation ID when using the item.

### animation2\_id

The animation ID when on the receiving end of the item.

### menu\_se

SE played when item is used on the menu screen ([RPG::AudioFile](https://enls.gitbook.io/rgss-reference-manual/game-library/rpgxp-data-structures/rpg-audiofile)).

### common\_event\_id

The Common Event ID.

### price

The item price.

### consumable

Truth value of whether the item disappears when used.

### parameter\_type

Parameter affected (0: none, 1: max HP, 2: max SP, 3: strength, 4: dexterity, 5: agility, 6: intelligence).

### parameter\_points

Amount by which parameter increases.

### recover\_hp\_rate

HP recovery rate.

### recover\_hp

HP recovery amount.

### recover\_sp\_rate

SP recovery rate.

### recover\_sp

SP recovery amount.

### hit

The item's hit probability.

### pdef\_f

The item's physical defense F rating.

### mdef\_f

The item's magic defense F rating.

### variance

The item's degree of variance.

### element\_set

The item's element. An Elemental ID array.

### plus\_state\_set

States to add. A State ID array.

### minus\_state\_set

States to cancel. A Stae ID array.

## Definition

```ruby
module RPG
  class Item
    def initialize
      @id = 0
      @name = ""
      @icon_name = ""
      @description = ""
      @scope = 0
      @occasion = 0
      @animation1_id = 0
      @animation2_id = 0
      @menu_se = RPG::AudioFile.new("", 80)
      @common_event_id = 0
      @price = 0
      @consumable = true
      @parameter_type = 0
      @parameter_points = 0
      @recover_hp_rate = 0
      @recover_hp = 0
      @recover_sp_rate = 0
      @recover_sp = 0
      @hit = 100
      @pdef_f = 0
      @mdef_f = 0
      @variance = 0
      @element_set = []
      @plus_state_set = []
      @minus_state_set = []
    end
    attr_accessor :id
    attr_accessor :name
    attr_accessor :icon_name
    attr_accessor :description
    attr_accessor :scope
    attr_accessor :occasion
    attr_accessor :animation1_id
    attr_accessor :animation2_id
    attr_accessor :menu_se
    attr_accessor :common_event_id
    attr_accessor :price
    attr_accessor :consumable
    attr_accessor :parameter_type
    attr_accessor :parameter_points
    attr_accessor :recover_hp_rate
    attr_accessor :recover_hp
    attr_accessor :recover_sp_rate
    attr_accessor :recover_sp
    attr_accessor :hit
    attr_accessor :pdef_f
    attr_accessor :mdef_f
    attr_accessor :variance
    attr_accessor :element_set
    attr_accessor :plus_state_set
    attr_accessor :minus_state_set
  end
end
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enls.gitbook.io/rgss-reference-manual/game-library/rpgxp-data-structures/rpg-item.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
