30#ifndef HORIZON_ZONE_STATICDB_ITEMDB_HPP
31#define HORIZON_ZONE_STATICDB_ITEMDB_HPP
71 return _refine_db.at(type, std::shared_ptr<refine_config>());
77 return arr !=
nullptr ? (*arr)[stype] : 100;
82 if (weapon_lv < 1 || weapon_lv > 5)
85 if (element < ELE_NEUTRAL || element >=
ELE_MAX)
88 if (def_ele < ELE_NEUTRAL || def_ele >=
ELE_MAX)
92 std::array<uint8_t, ELE_MAX> ele_arr = lvl_arr->at(element);
94 return ele_arr[def_ele];
101 }
catch (std::exception & ) {
107 int load_items(sol::table
const &item_tbl, std::string file_path);
119#define ItemDB Horizon::Zone::ItemDatabase::get_instance()
refine_type
Definition: ItemDefinitions.hpp:80
#define MAX_REFINE_LEVEL
Definition: ItemDefinitions.hpp:43
item_weapon_type
Definition: ItemDefinitions.hpp:99
@ REFINE_CHANCE_TYPE_MAX
Definition: ItemDefinitions.hpp:95
element_type
Definition: UnitDefinitions.hpp:970
@ ELE_MAX
Definition: UnitDefinitions.hpp:981
unit_size_type
Definition: UnitDefinitions.hpp:36
Definition: ItemDB.hpp:42
static ItemDatabase * get_instance()
Definition: ItemDB.hpp:53
std::array< std::string, IT_WT_SINGLE_MAX > _weapontype2name_db
Definition: ItemDB.hpp:109
bool load_weapon_attribute_modifiers_db()
Definition: ItemDB.cpp:742
LockedLookupTable< int32_t, std::shared_ptr< const refine_config > > _refine_db
Definition: ItemDB.hpp:112
bool add_job_group_to_item(std::string const &group, item_config_data &id, bool enable, std::string const &file_path)
Definition: ItemDB.cpp:104
std::string get_weapon_type_name(item_weapon_type type)
Definition: ItemDB.hpp:97
LockedLookupTable< int32_t, std::shared_ptr< std::array< uint8_t, ESZ_MAX > > > _weapon_target_size_modifiers_db
Definition: ItemDB.hpp:113
std::shared_ptr< const item_config_data > get_item_by_id(uint32_t item_id) const
Definition: ItemDB.hpp:66
int32_t get_weapon_attribute_modifier(int32_t weapon_lv, element_type element, element_type def_ele)
Definition: ItemDB.hpp:80
~ItemDatabase()
Definition: ItemDB.hpp:51
ItemDatabase()
Definition: ItemDB.cpp:39
LockedLookupTable< int32_t, std::shared_ptr< std::array< std::array< uint8_t, ELE_MAX >, ELE_MAX > > > _weapon_attribute_modifiers_db
Definition: ItemDB.hpp:114
std::shared_ptr< const refine_config > get_refine_config(refine_type type)
Definition: ItemDB.hpp:69
bool load_weapon_target_size_modifiers_db()
Definition: ItemDB.cpp:696
bool load_refine_table(refine_type tbl_type, sol::table const &refine_table, std::string table_name, std::string file_path)
Definition: ItemDB.cpp:649
bool load_refine_db()
Definition: ItemDB.cpp:612
uint8_t get_weapon_target_size_modifier(item_weapon_type wtype, unit_size_type stype)
Definition: ItemDB.hpp:74
int load_items(sol::table const &item_tbl, std::string file_path)
Definition: ItemDB.cpp:353
bool load()
Definition: ItemDB.cpp:68
LockedLookupTable< std::string, std::shared_ptr< const item_config_data > > _item_db_str
Definition: ItemDB.hpp:111
std::shared_ptr< const item_config_data > get_item_by_key_name(std::string key_name) const
Definition: ItemDB.hpp:67
LockedLookupTable< int32_t, std::shared_ptr< const item_config_data > > _item_db
Definition: ItemDB.hpp:110
Definition: LockedLookupTable.hpp:44
Value at(Key const &key, Value const &default_value=Value()) const
Definition: LockedLookupTable.hpp:63
Definition: Element.hpp:7
Definition: ItemDB.hpp:44
int bonus[MAX_REFINE_LEVEL]
Definition: ItemDB.hpp:46
int chance[REFINE_CHANCE_TYPE_MAX][MAX_REFINE_LEVEL]
Definition: ItemDB.hpp:45
int randombonus_max[MAX_REFINE_LEVEL]
Definition: ItemDB.hpp:47
Definition: ItemDefinitions.hpp:334