diff --git a/src/ItemParameterTable.cc b/src/ItemParameterTable.cc index 07e6b822..46139e33 100644 --- a/src/ItemParameterTable.cc +++ b/src/ItemParameterTable.cc @@ -141,6 +141,14 @@ uint8_t ItemParameterTable::get_special_stars(uint8_t det) const { return this->get_item_stars(det + 0x0256); } +const ItemParameterTable::Special& ItemParameterTable::get_special(uint8_t special) const { + special &= 0x3F; + if (special >= 0x29) { + throw runtime_error("invalid special index"); + } + return this->r.pget(this->offsets->special_data_table + sizeof(Special) * special); +} + uint8_t ItemParameterTable::get_max_tech_level(uint8_t char_class, uint8_t tech_num) const { if (char_class >= 12) { throw runtime_error("invalid character class"); diff --git a/src/ItemParameterTable.hh b/src/ItemParameterTable.hh index 8714b1dc..46c7f59b 100644 --- a/src/ItemParameterTable.hh +++ b/src/ItemParameterTable.hh @@ -225,6 +225,7 @@ public: const MagFeedResult& get_mag_feed_result(uint8_t table_index, uint8_t which) const; uint8_t get_item_stars(uint16_t slot) const; uint8_t get_special_stars(uint8_t det) const; + const Special& get_special(uint8_t special) const; uint8_t get_max_tech_level(uint8_t char_class, uint8_t tech_num) const; const ItemBase& get_item_definition(const ItemData& item) const;