Class: RuneRb::Database::ItemDefinition

Inherits:
Object
  • Object
show all
Defined in:
app/database/models/item/definition.rb

Overview

Defining information related to a single game item.

Models a row of the `item_definitions` table.

Since:

  • 0.9.3

Instance Method Summary collapse

Instance Method Details

#alchemy_priceHash

The amount of gold produced if a player were to use either High Level Alchemy or Low Level Alchemy spells on the item with this definition.

Returns:

  • (Hash)

    a hash containing each result mapped to `:high_level` and `:low_level`.

Since:

  • 0.9.3


13
14
15
16
# File 'app/database/models/item/definition.rb', line 13

def alchemy_price
  { high_level: (0.6 * self[:value]).to_i,
    low_level: (0.4 * self[:value]).to_i }.freeze
end