Horizon Official Technical Documentation
Horizon::Zone::ItemComponent Class Reference

#include <ItemComponent.hpp>

+ Inheritance diagram for Horizon::Zone::ItemComponent:
+ Collaboration diagram for Horizon::Zone::ItemComponent:

Public Member Functions

 ItemComponent ()
 
 ItemComponent (std::shared_ptr< GameLogicProcess > container)
 
 ~ItemComponent ()
 
void sync_definitions (std::shared_ptr< sol::state > state)
 
void sync_data_types (std::shared_ptr< sol::state > state)
 
void sync_functions (std::shared_ptr< sol::state > state)
 
- Public Member Functions inherited from Horizon::Zone::LUAComponent
 LUAComponent ()
 
 LUAComponent (std::shared_ptr< GameLogicProcess > container)
 
 ~LUAComponent ()
 
virtual void sync_definitions (std::shared_ptr< sol::state > state)=0
 
virtual void sync_data_types (std::shared_ptr< sol::state > state)=0
 
virtual void sync_functions (std::shared_ptr< sol::state > state)=0
 
std::shared_ptr< GameLogicProcessget_container ()
 

Constructor & Destructor Documentation

◆ ItemComponent() [1/2]

Horizon::Zone::ItemComponent::ItemComponent ( )
inline
43{ }

◆ ItemComponent() [2/2]

Horizon::Zone::ItemComponent::ItemComponent ( std::shared_ptr< GameLogicProcess container)
inline
44: LUAComponent(container) { }
LUAComponent()
Definition: LUAComponent.hpp:42

◆ ~ItemComponent()

Horizon::Zone::ItemComponent::~ItemComponent ( )
inline
45{ }

Member Function Documentation

◆ sync_data_types()

void ItemComponent::sync_data_types ( std::shared_ptr< sol::state >  state)
virtual

Implements Horizon::Zone::LUAComponent.

218{
219 state->new_usertype<item_entry_data::options>("item_options",
222 );
223
224 sol::usertype<item_entry_data> config_1 = state->new_usertype<item_entry_data>("item_entry_data");
225 config_1["is_equipment"] = &item_entry_data::is_equipment;
226 config_1["is_stackable"] = &item_entry_data::is_stackable;
227 config_1["is_same_as"] = &item_entry_data::operator ==;
228 config_1["storage_type"] = &item_entry_data::storage_type;
229 config_1["storage_index"] = [] (item_entry_data &item) {
230 return std::ref(item.index.storage);
231 };
232 config_1["inventory_index"] = [] (item_entry_data &item) {
233 return std::ref(item.index.inventory);
234 };
235 config_1["item_id"] = sol::readonly(&item_entry_data::item_id);
236 config_1["type"] = sol::readonly(&item_entry_data::type);
237 config_1["amount"] = sol::readonly(&item_entry_data::amount);
238 config_1["current_equip_location_mask"] = sol::readonly(&item_entry_data::current_equip_location_mask);
239 config_1["actual_equip_location_mask"] = sol::readonly(&item_entry_data::actual_equip_location_mask);
240 config_1["refine_level"] = sol::property(&item_entry_data::get_refine_level, &item_entry_data::set_refine_level);
241 config_1["slot_item_id"] = sol::property([] (item_entry_data &item) {
242 return std::ref(item.slot_item_id);
243 });
244 config_1["hire_expire_date"] = sol::property(&item_entry_data::get_hire_expire_date, &item_entry_data::set_hire_expire_date);
245 config_1["bind_type"] = sol::property(&item_entry_data::get_bind_type, &item_entry_data::set_bind_type);
246 config_1["sprite_id"] = sol::readonly(&item_entry_data::sprite_id);
247 config_1["ele_type"] = sol::readonly(&item_entry_data::ele_type);
248 config_1["option_count"] = sol::property(&item_entry_data::get_option_count, &item_entry_data::set_option_count);
249 config_1["options_data"] = sol::property([] (item_entry_data &item) {
250 return std::ref(item.option_data);
251 });
252 config_1["unique_id"] = sol::readonly(&item_entry_data::unique_id);
253
254 sol::usertype<item_config_data> config_2 = state->new_usertype<item_config_data>("item_config_data");
255 config_2["item_id"] = sol::readonly(&item_config_data::item_id);
256 config_2["name"] = sol::readonly(&item_config_data::name);
257 config_2["key_name"] = sol::readonly(&item_config_data::key_name);
258 config_2["value_buy"] = sol::readonly(&item_config_data::value_buy);
259 config_2["value_sell"] = sol::readonly(&item_config_data::value_sell);
260 config_2["type"] = sol::readonly(&item_config_data::type);
261 config_2["item_sub_type"] = sol::readonly_property([] (item_config_data &item) {
262 return item.type == IT_TYPE_WEAPON ? item.sub_type.weapon_t : item.sub_type.ammo_t;
263 });
264 config_2["equip_location_mask"] = sol::readonly(&item_config_data::equip_location_mask);
265 config_2["weight"] = sol::readonly(&item_config_data::weight);
266 config_2["attack"] = sol::readonly(&item_config_data::attack);
267 config_2["defense"] = sol::readonly(&item_config_data::defense);
268 config_2["attack_range"] = sol::readonly(&item_config_data::attack_range);
269 config_2["card_slot_count"] = sol::readonly(&item_config_data::card_slot_count);
270 config_2["sprite_id"] = sol::readonly(&item_config_data::sprite_id);
271 config_2["level"] = sol::readonly_property([] (item_config_data &item) {
272 return item.type == IT_TYPE_WEAPON ? (uint8_t) item.level.weapon : (uint8_t) item.level.armor;
273 });
274 config_2["magic_atk"] = sol::readonly(&item_config_data::magic_atk);
275 config_2["req_min_lv"] = sol::readonly_property([] (item_config_data &item) {
276 return item.requirements.min_lv;
277 });
278 config_2["req_max_lv"] = sol::readonly_property([] (item_config_data &item) {
279 return item.requirements.max_lv;
280 });
281 config_2["req_job_ids"] = sol::readonly_property([] (item_config_data &item) {
282 return item.requirements.job_ids;
283 });
284 config_2["req_gender"] = sol::readonly_property([] (item_config_data &item) {
285 return item.requirements.gender;
286 });
287 config_2["default_script"] = sol::readonly(&item_config_data::default_script);
288 config_2["equip_script"] = sol::readonly(&item_config_data::equip_script);
289 config_2["unequip_script"] = sol::readonly(&item_config_data::unequip_script);
290 config_2["available"] = sol::readonly_property([] (item_config_data &item) {
291 return item.config.available ? 1 : 0;
292 });
293 config_2["refineable"] = sol::readonly_property([] (item_config_data &item) {
294 return item.config.refineable ? 1 : 0;
295 });
296 config_2["trade_restriction_mask"] = sol::readonly_property([] (item_config_data &item) {
297 return (int) item.trade_restriction_mask;
298 });
299 config_2["trade_restriction_group_override_id"] = sol::readonly_property([] (item_config_data &item) {
300 return (int) item.trade_restriction_group_override_id;
301 });
302 config_2["trade_restriction_partner_override"] = sol::readonly_property([] (item_config_data &item) {
303 return (bool) item.trade_restriction_partner_override;
304 });
305 config_2["usage_restriction_mask"] = sol::readonly_property([] (item_config_data &item) {
306 return (int) item.usage_restriction_mask;
307 });
308 config_2["usage_restriction_group_override_id"] = sol::readonly_property([] (item_config_data &item) {
309 return (int) item.usage_restriction_group_override_id;
310 });
311 config_2["allow_item_options"] = sol::readonly_property([] (item_config_data &item) {
312 return item.config.allow_item_options ? 1 : 0;
313 });
314 config_2["bind_on_equip"] = sol::readonly_property([] (item_config_data &item) {
315 return item.config.bind_on_equip ? 1 : 0;
316 });
317 config_2["drop_announce"] = sol::readonly_property([] (item_config_data &item) {
318 return item.config.drop_announce ? 1 :0;
319 });
320
321 sol::usertype<s_grid_notify_item_drop_entry> item_drop = state->new_usertype<s_grid_notify_item_drop_entry>("s_grid_notify_item_drop_entry");
322 item_drop["guid"] = &s_grid_notify_item_drop_entry::guid;
323 item_drop["item_id"] = &s_grid_notify_item_drop_entry::item_id;
324 item_drop["type"] = &s_grid_notify_item_drop_entry::type;
325 item_drop["is_identified"] = &s_grid_notify_item_drop_entry::is_identified;
326 item_drop["x"] = &s_grid_notify_item_drop_entry::x;
327 item_drop["y"] = &s_grid_notify_item_drop_entry::y;
328 item_drop["x_area"] = &s_grid_notify_item_drop_entry::x_area;
329 item_drop["y_area"] = &s_grid_notify_item_drop_entry::y_area;
330 item_drop["amount"] = &s_grid_notify_item_drop_entry::amount;
331 item_drop["show_drop_effect"] = &s_grid_notify_item_drop_entry::show_drop_effect;
332 item_drop["drop_effect_mode"] = &s_grid_notify_item_drop_entry::drop_effect_mode;
333}
@ IT_TYPE_WEAPON
Definition: ItemDefinitions.hpp:258
Definition: ItemDefinitions.hpp:334
std::string default_script
Default script for everything.
Definition: ItemDefinitions.hpp:373
int8_t attack_range
Definition: ItemDefinitions.hpp:352
int8_t armor
Definition: ItemDefinitions.hpp:357
int32_t min_lv
Definition: ItemDefinitions.hpp:364
unsigned trade_restriction_mask
Item trade restrictions mask (.
Definition: ItemDefinitions.hpp:387
unsigned bind_on_equip
Definition: ItemDefinitions.hpp:381
item_ammunition_type ammo_t
Definition: ItemDefinitions.hpp:345
int32_t value_buy
Definition: ItemDefinitions.hpp:338
int32_t max_lv
Definition: ItemDefinitions.hpp:363
std::string equip_script
Script executed once when equipping.
Definition: ItemDefinitions.hpp:374
int8_t weapon
Definition: ItemDefinitions.hpp:358
int trade_restriction_group_override_id
Definition: ItemDefinitions.hpp:399
struct item_config_data::@128 requirements
int32_t defense
Definition: ItemDefinitions.hpp:351
std::string key_name
Definition: ItemDefinitions.hpp:336
item_weapon_type weapon_t
Definition: ItemDefinitions.hpp:344
std::vector< uint32_t > job_ids
Definition: ItemDefinitions.hpp:365
item_gender_type gender
Definition: ItemDefinitions.hpp:366
std::string unequip_script
Script executed once when unequipping.
Definition: ItemDefinitions.hpp:375
unsigned refineable
Definition: ItemDefinitions.hpp:379
uint64_t equip_location_mask
Definition: ItemDefinitions.hpp:348
item_type type
Definition: ItemDefinitions.hpp:341
int usage_restriction_group_override_id
Definition: ItemDefinitions.hpp:397
int32_t attack
Definition: ItemDefinitions.hpp:350
int32_t value_sell
Definition: ItemDefinitions.hpp:339
unsigned allow_item_options
disallows use of item options on the item. (non-equippable items are automatically flagged)
Definition: ItemDefinitions.hpp:384
unsigned drop_announce
Official Drop Announce.
Definition: ItemDefinitions.hpp:385
int usage_restriction_mask
Definition: ItemDefinitions.hpp:397
unsigned available
Definition: ItemDefinitions.hpp:378
union item_config_data::@127 level
bool trade_restriction_partner_override
Definition: ItemDefinitions.hpp:400
std::string name
Definition: ItemDefinitions.hpp:336
int32_t magic_atk
Definition: ItemDefinitions.hpp:361
uint32_t item_id
Definition: ItemDefinitions.hpp:335
uint32_t weight
Definition: ItemDefinitions.hpp:349
struct item_config_data::@129 config
int8_t card_slot_count
Definition: ItemDefinitions.hpp:353
uint32_t sprite_id
Definition: ItemDefinitions.hpp:354
Definition: ItemDefinitions.hpp:553
int16_t get_index() const
Definition: ItemDefinitions.hpp:554
void set_index(int idx)
Definition: ItemDefinitions.hpp:555
void set_value(int val)
Definition: ItemDefinitions.hpp:558
int16_t get_value() const
Definition: ItemDefinitions.hpp:557
Structure used to store and convey item data in the state machine and in communication with the clien...
Definition: ItemDefinitions.hpp:414
uint32_t actual_equip_location_mask
Definition: ItemDefinitions.hpp:539
uint16_t sprite_id
Definition: ItemDefinitions.hpp:549
void set_bind_type(item_bind_type val)
Definition: ItemDefinitions.hpp:515
uint64_t unique_id
Definition: ItemDefinitions.hpp:572
struct item_entry_data::options option_data[MAX_ITEM_OPTIONS]
uint32_t current_equip_location_mask
Definition: ItemDefinitions.hpp:538
bool is_stackable()
Definition: ItemDefinitions.hpp:419
void set_option_count(uint8_t count)
Definition: ItemDefinitions.hpp:518
item_bind_type get_bind_type()
Definition: ItemDefinitions.hpp:514
bool is_equipment()
Definition: ItemDefinitions.hpp:417
element_type ele_type
Definition: ItemDefinitions.hpp:551
uint32_t slot_item_id[MAX_ITEM_SLOTS]
Definition: ItemDefinitions.hpp:544
item_type type
Definition: ItemDefinitions.hpp:536
uint32_t item_id
Definition: ItemDefinitions.hpp:532
uint8_t get_refine_level()
Definition: ItemDefinitions.hpp:508
uint32_t get_hire_expire_date()
Definition: ItemDefinitions.hpp:511
void set_refine_level(int lvl)
Definition: ItemDefinitions.hpp:509
uint16_t amount
Definition: ItemDefinitions.hpp:537
void set_hire_expire_date(int date)
Definition: ItemDefinitions.hpp:512
uint8_t get_option_count()
Definition: ItemDefinitions.hpp:517
item_storage_type storage_type
Definition: ItemDefinitions.hpp:528
Definition: GridNotifiers.hpp:434
int guid
Definition: GridNotifiers.hpp:435
int show_drop_effect
Definition: GridNotifiers.hpp:436
int item_id
Definition: GridNotifiers.hpp:435
int y
Definition: GridNotifiers.hpp:435
int type
Definition: GridNotifiers.hpp:435
int drop_effect_mode
Definition: GridNotifiers.hpp:436
int x
Definition: GridNotifiers.hpp:435
int amount
Definition: GridNotifiers.hpp:435
int x_area
Definition: GridNotifiers.hpp:435
int is_identified
Definition: GridNotifiers.hpp:435
int y_area
Definition: GridNotifiers.hpp:435

References item_entry_data::actual_equip_location_mask, item_entry_data::amount, s_grid_notify_item_drop_entry::amount, item_config_data::attack, item_config_data::attack_range, item_config_data::card_slot_count, item_entry_data::config, item_entry_data::current_equip_location_mask, item_config_data::default_script, item_config_data::defense, s_grid_notify_item_drop_entry::drop_effect_mode, item_entry_data::ele_type, item_config_data::equip_location_mask, item_config_data::equip_script, item_entry_data::get_bind_type(), item_entry_data::get_hire_expire_date(), item_entry_data::options::get_index(), item_entry_data::get_option_count(), item_entry_data::get_refine_level(), item_entry_data::options::get_value(), s_grid_notify_item_drop_entry::guid, item_entry_data::is_equipment(), s_grid_notify_item_drop_entry::is_identified, item_entry_data::is_stackable(), IT_TYPE_WEAPON, item_config_data::item_id, item_entry_data::item_id, s_grid_notify_item_drop_entry::item_id, item_config_data::key_name, item_config_data::magic_atk, item_config_data::name, item_entry_data::option_data, item_entry_data::set_bind_type(), item_entry_data::set_hire_expire_date(), item_entry_data::options::set_index(), item_entry_data::set_option_count(), item_entry_data::set_refine_level(), item_entry_data::options::set_value(), s_grid_notify_item_drop_entry::show_drop_effect, item_entry_data::slot_item_id, item_config_data::sprite_id, item_entry_data::sprite_id, item_entry_data::storage_type, item_config_data::type, item_entry_data::type, s_grid_notify_item_drop_entry::type, item_config_data::unequip_script, item_entry_data::unique_id, item_config_data::value_buy, item_config_data::value_sell, item_config_data::weight, s_grid_notify_item_drop_entry::x, s_grid_notify_item_drop_entry::x_area, s_grid_notify_item_drop_entry::y, and s_grid_notify_item_drop_entry::y_area.

+ Here is the call graph for this function:

◆ sync_definitions()

void ItemComponent::sync_definitions ( std::shared_ptr< sol::state >  state)
virtual

< 2 daggers

< 2 swords

< 2 axes

< dagger + sword

< dagger + axe

< sword + axe

Implements Horizon::Zone::LUAComponent.

40{
41 sol::table tbl_1 = state->create_named_table("RefineType");
42 tbl_1["Armor"] = (int) REFINE_TYPE_ARMOR;
43 tbl_1["Weapon1"] = (int) REFINE_TYPE_WEAPON1;
44 tbl_1["Weapon2"] = (int) REFINE_TYPE_WEAPON2;
45 tbl_1["Weapon3"] = (int) REFINE_TYPE_WEAPON3;
46 tbl_1["Weapon4"] = (int) REFINE_TYPE_WEAPON4;
47 tbl_1["Max"] = (int) REFINE_TYPE_MAX;
48
49 sol::table tbl_2 = state->create_named_table("RefineChanceType");
50 tbl_2["Normal"] = (int) REFINE_CHANCE_TYPE_NORMAL;
51 tbl_2["Enriched"] = (int) REFINE_CHANCE_TYPE_ENRICHED;
52 tbl_2["EventNormal"] = (int) REFINE_CHANCE_TYPE_E_NORMAL;
53 tbl_2["EventEnriched"] = (int) REFINE_CHANCE_TYPE_E_ENRICHED;
54 tbl_2["Max"] = (int) REFINE_CHANCE_TYPE_MAX;
55
56 sol::table tbl_3 = state->create_named_table("WeaponType");
57 tbl_3["Fist"] = (int) IT_WT_FIST;
58 tbl_3["Dagger"] = (int) IT_WT_DAGGER;
59 tbl_3["OneHandedSword"] = (int) IT_WT_1HSWORD;
60 tbl_3["TwoHandedSword"] = (int) IT_WT_2HSWORD;
61 tbl_3["OneHandedSpear"] = (int) IT_WT_1HSPEAR;
62 tbl_3["TwoHandedSpear"] = (int) IT_WT_2HSPEAR;
63 tbl_3["OneHandedAxe"] = (int) IT_WT_1HAXE;
64 tbl_3["TwoHandedAxe"] = (int) IT_WT_2HAXE;
65 tbl_3["OneHandedMace"] = (int) IT_WT_1HMACE;
66 tbl_3["TwoHandedMace"] = (int) IT_WT_2HMACE;
67 tbl_3["OneHandedStaff"] = (int) IT_WT_STAFF;
68 tbl_3["Bow"] = (int) IT_WT_BOW;
69 tbl_3["Knuckle"] = (int) IT_WT_KNUCKLE;
70 tbl_3["MusicalInstrument"] = (int) IT_WT_MUSICAL;
71 tbl_3["Whip"] = (int) IT_WT_WHIP;
72 tbl_3["Book"] = (int) IT_WT_BOOK;
73 tbl_3["Katar"] = (int) IT_WT_KATAR;
74 tbl_3["Revolver"] = (int) IT_WT_REVOLVER;
75 tbl_3["Rifle"] = (int) IT_WT_RIFLE;
76 tbl_3["GatlingGun"] = (int) IT_WT_GATLING;
77 tbl_3["Shotgun"] = (int) IT_WT_SHOTGUN;
78 tbl_3["GrenadeLauncher"] = (int) IT_WT_GRENADE;
79 tbl_3["FuumaShuriken"] = (int) IT_WT_HUUMA;
80 tbl_3["TwoHandedStaff"] = (int) IT_WT_2HSTAFF;
81 tbl_3["DWDaggers"] = (int) IT_WT_DOUBLE_DAGGERS;
82 tbl_3["DWSwords"] = (int) IT_WT_DOUBLE_SWORDS;
83 tbl_3["DWAxes"] = (int) IT_WT_DOUBLE_AXES;
84 tbl_3["DWDaggerSword"] = (int) IT_WT_DOUBLE_DAGGER_SWORD;
85 tbl_3["DWDaggerAxe"] = (int) IT_WT_DOUBLE_DAGGER_AXE;
86 tbl_3["DWSwordAxe"] = (int) IT_WT_DOUBLE_SWORD_AXE;
87
88 sol::table tbl_4 = state->create_named_table("WeaponTypeMask");
89 tbl_4["Ranged"] = (int) IT_WTM_RANGED;
90 tbl_4["Melee"] = (int) IT_WTM_MELEE;
91
92 sol::table tbl_5 = state->create_named_table("ItemLevelType");
93 tbl_5["Armor"] = (int) IT_LVL_ARMOR;
94 tbl_5["Weapon1"] = (int) IT_LVL_WEAPON1;
95 tbl_5["Weapon2"] = (int) IT_LVL_WEAPON2;
96 tbl_5["Weapon3"] = (int) IT_LVL_WEAPON3;
97 tbl_5["Weapon4"] = (int) IT_LVL_WEAPON4;
98 tbl_5["Max"] = (int) IT_LVL_MAX;
99
100 sol::table tbl_6 = state->create_named_table("ItemGenderType");
101 tbl_6["Female"] = (int) IT_GENDER_FEMALE;
102 tbl_6["Male"] = (int) IT_GENDER_MALE;
103 tbl_6["Any"] = (int) IT_GENDER_ANY;
104
105 sol::table tbl_7 = state->create_named_table("EquipLocationMask");
106 tbl_7["None"] = (int) IT_EQPM_NONE;
107 tbl_7["LowerHead"] = (int) IT_EQPM_HEAD_LOW;
108 tbl_7["RightHand"] = (int) IT_EQPM_HAND_R;
109 tbl_7["Garment"] = (int) IT_EQPM_GARMENT;
110 tbl_7["LeftAccessory"] = (int) IT_EQPM_ACC_L;
111 tbl_7["Armor"] = (int) IT_EQPM_ARMOR;
112 tbl_7["LeftHand"] = (int) IT_EQPM_HAND_L;
113 tbl_7["Shoes"] = (int) IT_EQPM_SHOES;
114 tbl_7["RightAccessory"] = (int) IT_EQPM_ACC_R;
115 tbl_7["TopHead"] = (int) IT_EQPM_HEAD_TOP;
116 tbl_7["MidHead"] = (int) IT_EQPM_HEAD_MID;
117 tbl_7["CostumeTopHead"] = (int) IT_EQPM_COSTUME_HEAD_TOP;
118 tbl_7["CostumeMidHead"] = (int) IT_EQPM_COSTUME_HEAD_MID;
119 tbl_7["CostumeLowerHead"] = (int) IT_EQPM_COSTUME_HEAD_LOW;
120 tbl_7["CostumeGarment"] = (int) IT_EQPM_COSTUME_GARMENT;
121 tbl_7["Ammunition"] = (int) IT_EQPM_AMMO;
122 tbl_7["ShadowArmor"] = (int) IT_EQPM_SHADOW_ARMOR;
123 tbl_7["ShadowWeapon"] = (int) IT_EQPM_SHADOW_WEAPON;
124 tbl_7["ShadowShield"] = (int) IT_EQPM_SHADOW_SHIELD;
125 tbl_7["ShadowShoes"] = (int) IT_EQPM_SHADOW_SHOES;
126 tbl_7["ShadowRightAccessory"] = (int) IT_EQPM_SHADOW_ACC_R;
127 tbl_7["ShadowLeftAccessory"] = (int) IT_EQPM_SHADOW_ACC_L;
128 tbl_7["Weapon"] = (int) IT_EQPM_WEAPON;
129 tbl_7["Shield"] = (int) IT_EQPM_SHIELD;
130 tbl_7["BothArms"] = (int) IT_EQPM_ARMS;
131 tbl_7["AllHeadgear"] = (int) IT_EQPM_HELM;
132 tbl_7["AllAccessory"] = (int) IT_EQPM_ACC;
133 tbl_7["AllCostume"] = (int) IT_EQPM_COSTUME;
134 tbl_7["ShadowAccessory"] = (int) IT_EQPM_SHADOW_ACC;
135 tbl_7["ShadowArms"] = (int) IT_EQPM_SHADOW_ARMS;
136
137 sol::table tbl_8 = state->create_named_table("EquipLocationIndex");
138 tbl_8["LeftAccessory"] = (int) IT_EQPI_ACC_L;
139 tbl_8["RightAccessory"] = (int) IT_EQPI_ACC_R;
140 tbl_8["Shoes"] = (int) IT_EQPI_SHOES;
141 tbl_8["Garment"] = (int) IT_EQPI_GARMENT;
142 tbl_8["LowerHead"] = (int) IT_EQPI_HEAD_LOW;
143 tbl_8["MidHead"] = (int) IT_EQPI_HEAD_MID;
144 tbl_8["TopHead"] = (int) IT_EQPI_HEAD_TOP;
145 tbl_8["Armor"] = (int) IT_EQPI_ARMOR;
146 tbl_8["LeftHand"] = (int) IT_EQPI_HAND_L;
147 tbl_8["RightHand"] = (int) IT_EQPI_HAND_R;
148 tbl_8["CostumeTopHead"] = (int) IT_EQPI_COSTUME_TOP;
149 tbl_8["CostumeMidHead"] = (int) IT_EQPI_COSTUME_MID;
150 tbl_8["CostumeLowHead"] = (int) IT_EQPI_COSTUME_LOW;
151 tbl_8["CostumeGarment"] = (int) IT_EQPI_COSTUME_GARMENT;
152 tbl_8["Ammunition"] = (int) IT_EQPI_AMMO;
153 tbl_8["ShadowArmor"] = (int) IT_EQPI_SHADOW_ARMOR;
154 tbl_8["ShadowWeapon"] = (int) IT_EQPI_SHADOW_WEAPON;
155 tbl_8["ShadowShield"] = (int) IT_EQPI_SHADOW_SHIELD;
156 tbl_8["ShadowShoes"] = (int) IT_EQPI_SHADOW_SHOES;
157 tbl_8["ShadowRightAccessory"] = (int) IT_EQPI_SHADOW_ACC_R;
158 tbl_8["ShadowLeftAccessory"] = (int) IT_EQPI_SHADOW_ACC_L;
159 tbl_8["Max"] = (int) IT_EQPI_MAX;
160
161 sol::table tbl_9 = state->create_named_table("ItemTradeMask");
162 tbl_9["None"] = (int) ITRMASK_NONE;
163 tbl_9["Drop"] = (int) ITRMASK_DROP;
164 tbl_9["Trade"] = (int) ITRMASK_TRADE;
165 tbl_9["TradeWithPartner"] = (int) ITRMASK_TRADEWPARTNER;
166 tbl_9["SellToNPC"] = (int) ITRMASK_SELL_TO_NPC;
167 tbl_9["StoreInCart"] = (int) ITRMASK_CART;
168 tbl_9["StoreInStorage"] = (int) ITRMASK_STORAGE;
169 tbl_9["StoreInGuildStorage"] = (int) ITRMASK_GSTORAGE;
170 tbl_9["Mail"] = (int) ITRMASK_MAIL;
171 tbl_9["Auction"] = (int) ITRMASK_AUCTION;
172 tbl_9["SellInBuyingStore"] = (int) ITRMASK_BUYING_STORE;
173 tbl_9["AllowAll"] = (int) ITRMASK_ALL;
174
175 sol::table tbl_10 = state->create_named_table("ItemUsageMask");
176 tbl_10["Sitting"] = (int) IURMASK_SITTING;
177 tbl_10["All"] = (int) IURMASK_ALL;
178
179 sol::table tbl_11 = state->create_named_table("ItemType");
180 tbl_11["Healing"] = (int) IT_TYPE_HEALING;
181 tbl_11["Unknown"] = (int) IT_TYPE_UNKNOWN;
182 tbl_11["Usable"] = (int) IT_TYPE_USABLE;
183 tbl_11["Etc"] = (int) IT_TYPE_ETC;
184 tbl_11["Weapon"] = (int) IT_TYPE_WEAPON;
185 tbl_11["Armor"] = (int) IT_TYPE_ARMOR;
186 tbl_11["Card"] = (int) IT_TYPE_CARD;
187 tbl_11["PetEgg"] = (int) IT_TYPE_PET_EGG;
188 tbl_11["PetArmor"] = (int) IT_TYPE_PET_ARMOR;
189 tbl_11["Unknown2"] = (int) IT_TYPE_UNKNOWN2;
190 tbl_11["Ammunition"] = (int) IT_TYPE_AMMO;
191 tbl_11["ConsumptionDelay"] = (int) IT_TYPE_CONSUMPTION_DELAY;
192 tbl_11["Cash"] = (int) IT_TYPE_CASH;
193 tbl_11["Max"] = (int) IT_TYPE_MAX;
194
195 sol::table tbl_12 = state->create_named_table("AmmoType");
196 tbl_12["None"] = (int) IT_AT_NONE;
197 tbl_12["Arrow"] = (int) IT_AT_ARROW;
198 tbl_12["ThrowableDagger"] = (int) IT_AT_DAGGER;
199 tbl_12["Bullet"] = (int) IT_AT_BULLET;
200 tbl_12["Shell"] = (int) IT_AT_SHELL;
201 tbl_12["Grenade"] = (int) IT_AT_GRENADE;
202 tbl_12["Shuriken"] = (int) IT_AT_SHURIKEN;
203 tbl_12["Kunai"] = (int) IT_AT_KUNAI;
204 tbl_12["CannonBall"] = (int) IT_AT_CANNONBALL;
205 tbl_12["ThrowableItem"] = (int) IT_AT_THROWABLE_ITEM;
206 tbl_12["Max"] = (int) IT_AT_MAX;
207
208 sol::table tbl_13 = state->create_named_table("ItemBindType");
209 tbl_13["None"] = (int) IT_BIND_NONE;
210 tbl_13["Account"] = (int) IT_BIND_ACCOUNT;
211 tbl_13["Guild"] = (int) IT_BIND_GUILD;
212 tbl_13["Party"] = (int) IT_BIND_PARTY;
213 tbl_13["Character"] = (int) IT_BIND_CHARACTER;
214 tbl_13["Max"] = (int) IT_BIND_MAX;
215}
@ IT_AT_BULLET
Definition: ItemDefinitions.hpp:275
@ IT_AT_CANNONBALL
Definition: ItemDefinitions.hpp:280
@ IT_AT_KUNAI
Definition: ItemDefinitions.hpp:279
@ IT_AT_GRENADE
Definition: ItemDefinitions.hpp:277
@ IT_AT_SHURIKEN
Definition: ItemDefinitions.hpp:278
@ IT_AT_SHELL
Definition: ItemDefinitions.hpp:276
@ IT_AT_DAGGER
Definition: ItemDefinitions.hpp:274
@ IT_AT_ARROW
Definition: ItemDefinitions.hpp:273
@ IT_AT_NONE
Definition: ItemDefinitions.hpp:272
@ IT_AT_MAX
Definition: ItemDefinitions.hpp:282
@ IT_AT_THROWABLE_ITEM
Definition: ItemDefinitions.hpp:281
@ REFINE_TYPE_WEAPON1
Definition: ItemDefinitions.hpp:82
@ REFINE_TYPE_WEAPON4
Definition: ItemDefinitions.hpp:85
@ REFINE_TYPE_ARMOR
Definition: ItemDefinitions.hpp:81
@ REFINE_TYPE_WEAPON2
Definition: ItemDefinitions.hpp:83
@ REFINE_TYPE_MAX
Definition: ItemDefinitions.hpp:86
@ REFINE_TYPE_WEAPON3
Definition: ItemDefinitions.hpp:84
@ ITRMASK_AUCTION
Item can be auctioned.
Definition: ItemDefinitions.hpp:240
@ ITRMASK_DROP
Item can be dropped.
Definition: ItemDefinitions.hpp:232
@ ITRMASK_TRADE
Item can be traded (nor vended)
Definition: ItemDefinitions.hpp:233
@ ITRMASK_SELL_TO_NPC
Item can be sold to NPCs.
Definition: ItemDefinitions.hpp:235
@ ITRMASK_BUYING_STORE
Item can be listed in the buying store.
Definition: ItemDefinitions.hpp:241
@ ITRMASK_ALL
Sum of all the above values.
Definition: ItemDefinitions.hpp:242
@ ITRMASK_TRADEWPARTNER
Wedded partner can override ITR_NOTRADE restriction.
Definition: ItemDefinitions.hpp:234
@ ITRMASK_NONE
No restrictions.
Definition: ItemDefinitions.hpp:231
@ ITRMASK_MAIL
Item can be attached to mail messages.
Definition: ItemDefinitions.hpp:239
@ ITRMASK_CART
Item can be placed in the cart.
Definition: ItemDefinitions.hpp:236
@ ITRMASK_STORAGE
Item can be placed in the storage.
Definition: ItemDefinitions.hpp:237
@ ITRMASK_GSTORAGE
Item can be placed in the guild storage.
Definition: ItemDefinitions.hpp:238
@ IT_TYPE_ETC
Definition: ItemDefinitions.hpp:257
@ IT_TYPE_PET_ARMOR
Definition: ItemDefinitions.hpp:262
@ IT_TYPE_CASH
Definition: ItemDefinitions.hpp:266
@ IT_TYPE_HEALING
Definition: ItemDefinitions.hpp:254
@ IT_TYPE_UNKNOWN
Definition: ItemDefinitions.hpp:255
@ IT_TYPE_PET_EGG
Definition: ItemDefinitions.hpp:261
@ IT_TYPE_USABLE
Definition: ItemDefinitions.hpp:256
@ IT_TYPE_CONSUMPTION_DELAY
Definition: ItemDefinitions.hpp:265
@ IT_TYPE_ARMOR
Definition: ItemDefinitions.hpp:259
@ IT_TYPE_MAX
Definition: ItemDefinitions.hpp:267
@ IT_TYPE_CARD
Definition: ItemDefinitions.hpp:260
@ IT_TYPE_UNKNOWN2
Definition: ItemDefinitions.hpp:263
@ IT_TYPE_AMMO
Definition: ItemDefinitions.hpp:264
@ IT_EQPI_ACC_L
Definition: ItemDefinitions.hpp:205
@ IT_EQPI_SHADOW_ACC_L
Definition: ItemDefinitions.hpp:225
@ IT_EQPI_COSTUME_LOW
Definition: ItemDefinitions.hpp:217
@ IT_EQPI_HAND_L
Definition: ItemDefinitions.hpp:213
@ IT_EQPI_SHADOW_SHIELD
Definition: ItemDefinitions.hpp:222
@ IT_EQPI_SHADOW_ARMOR
Definition: ItemDefinitions.hpp:220
@ IT_EQPI_SHOES
Definition: ItemDefinitions.hpp:207
@ IT_EQPI_AMMO
Definition: ItemDefinitions.hpp:219
@ IT_EQPI_COSTUME_GARMENT
Definition: ItemDefinitions.hpp:218
@ IT_EQPI_SHADOW_WEAPON
Definition: ItemDefinitions.hpp:221
@ IT_EQPI_HEAD_LOW
Definition: ItemDefinitions.hpp:209
@ IT_EQPI_GARMENT
Definition: ItemDefinitions.hpp:208
@ IT_EQPI_HEAD_MID
Definition: ItemDefinitions.hpp:210
@ IT_EQPI_HAND_R
Definition: ItemDefinitions.hpp:214
@ IT_EQPI_ARMOR
Definition: ItemDefinitions.hpp:212
@ IT_EQPI_COSTUME_MID
Definition: ItemDefinitions.hpp:216
@ IT_EQPI_MAX
Definition: ItemDefinitions.hpp:226
@ IT_EQPI_ACC_R
Definition: ItemDefinitions.hpp:206
@ IT_EQPI_SHADOW_ACC_R
Definition: ItemDefinitions.hpp:224
@ IT_EQPI_COSTUME_TOP
Definition: ItemDefinitions.hpp:215
@ IT_EQPI_HEAD_TOP
Definition: ItemDefinitions.hpp:211
@ IT_EQPI_SHADOW_SHOES
Definition: ItemDefinitions.hpp:223
@ IT_BIND_ACCOUNT
Definition: ItemDefinitions.hpp:289
@ IT_BIND_PARTY
Definition: ItemDefinitions.hpp:291
@ IT_BIND_GUILD
Definition: ItemDefinitions.hpp:290
@ IT_BIND_MAX
Definition: ItemDefinitions.hpp:293
@ IT_BIND_CHARACTER
Definition: ItemDefinitions.hpp:292
@ IT_BIND_NONE
Definition: ItemDefinitions.hpp:287
@ IT_EQPM_SHADOW_WEAPON
Definition: ItemDefinitions.hpp:186
@ IT_EQPM_SHADOW_ACC_R
Definition: ItemDefinitions.hpp:189
@ IT_EQPM_SHOES
Definition: ItemDefinitions.hpp:175
@ IT_EQPM_COSTUME_HEAD_TOP
Definition: ItemDefinitions.hpp:179
@ IT_EQPM_AMMO
Definition: ItemDefinitions.hpp:184
@ IT_EQPM_ARMOR
Definition: ItemDefinitions.hpp:173
@ IT_EQPM_HEAD_MID
Definition: ItemDefinitions.hpp:178
@ IT_EQPM_ACC
Definition: ItemDefinitions.hpp:197
@ IT_EQPM_SHADOW_ACC
Definition: ItemDefinitions.hpp:199
@ IT_EQPM_COSTUME
Definition: ItemDefinitions.hpp:198
@ IT_EQPM_SHADOW_ARMS
Definition: ItemDefinitions.hpp:200
@ IT_EQPM_HAND_R
Definition: ItemDefinitions.hpp:170
@ IT_EQPM_WEAPON
Definition: ItemDefinitions.hpp:193
@ IT_EQPM_HELM
Definition: ItemDefinitions.hpp:196
@ IT_EQPM_HEAD_LOW
Definition: ItemDefinitions.hpp:169
@ IT_EQPM_HEAD_TOP
Definition: ItemDefinitions.hpp:177
@ IT_EQPM_SHADOW_SHOES
Definition: ItemDefinitions.hpp:188
@ IT_EQPM_HAND_L
Definition: ItemDefinitions.hpp:174
@ IT_EQPM_SHIELD
Definition: ItemDefinitions.hpp:194
@ IT_EQPM_ARMS
Definition: ItemDefinitions.hpp:195
@ IT_EQPM_COSTUME_HEAD_LOW
Definition: ItemDefinitions.hpp:181
@ IT_EQPM_SHADOW_ARMOR
Definition: ItemDefinitions.hpp:185
@ IT_EQPM_COSTUME_GARMENT
Definition: ItemDefinitions.hpp:182
@ IT_EQPM_SHADOW_SHIELD
Definition: ItemDefinitions.hpp:187
@ IT_EQPM_COSTUME_HEAD_MID
Definition: ItemDefinitions.hpp:180
@ IT_EQPM_ACC_R
Definition: ItemDefinitions.hpp:176
@ IT_EQPM_ACC_L
Definition: ItemDefinitions.hpp:172
@ IT_EQPM_NONE
Definition: ItemDefinitions.hpp:168
@ IT_EQPM_GARMENT
Definition: ItemDefinitions.hpp:171
@ IT_EQPM_SHADOW_ACC_L
Definition: ItemDefinitions.hpp:190
@ IT_WTM_MELEE
Definition: ItemDefinitions.hpp:142
@ IT_WTM_RANGED
Definition: ItemDefinitions.hpp:139
@ IT_WT_FIST
Bare hands.
Definition: ItemDefinitions.hpp:100
@ IT_WT_1HSWORD
Definition: ItemDefinitions.hpp:102
@ IT_WT_KATAR
Definition: ItemDefinitions.hpp:116
@ IT_WT_2HSPEAR
Definition: ItemDefinitions.hpp:105
@ IT_WT_2HMACE
Definition: ItemDefinitions.hpp:109
@ IT_WT_GATLING
Definition: ItemDefinitions.hpp:119
@ IT_WT_GRENADE
Definition: ItemDefinitions.hpp:121
@ IT_WT_DOUBLE_DAGGER_AXE
dagger + axe
Definition: ItemDefinitions.hpp:130
@ IT_WT_RIFLE
Definition: ItemDefinitions.hpp:118
@ IT_WT_2HAXE
Definition: ItemDefinitions.hpp:107
@ IT_WT_BOW
Definition: ItemDefinitions.hpp:111
@ IT_WT_2HSTAFF
Definition: ItemDefinitions.hpp:123
@ IT_WT_SHOTGUN
Definition: ItemDefinitions.hpp:120
@ IT_WT_DOUBLE_SWORDS
2 swords
Definition: ItemDefinitions.hpp:127
@ IT_WT_HUUMA
Definition: ItemDefinitions.hpp:122
@ IT_WT_1HSPEAR
Definition: ItemDefinitions.hpp:104
@ IT_WT_BOOK
Definition: ItemDefinitions.hpp:115
@ IT_WT_WHIP
Definition: ItemDefinitions.hpp:114
@ IT_WT_MUSICAL
Definition: ItemDefinitions.hpp:113
@ IT_WT_DOUBLE_DAGGER_SWORD
dagger + sword
Definition: ItemDefinitions.hpp:129
@ IT_WT_STAFF
Definition: ItemDefinitions.hpp:110
@ IT_WT_KNUCKLE
Definition: ItemDefinitions.hpp:112
@ IT_WT_DOUBLE_SWORD_AXE
sword + axe
Definition: ItemDefinitions.hpp:131
@ IT_WT_2HSWORD
Definition: ItemDefinitions.hpp:103
@ IT_WT_1HAXE
Definition: ItemDefinitions.hpp:106
@ IT_WT_1HMACE
Definition: ItemDefinitions.hpp:108
@ IT_WT_DAGGER
Definition: ItemDefinitions.hpp:101
@ IT_WT_DOUBLE_AXES
2 axes
Definition: ItemDefinitions.hpp:128
@ IT_WT_REVOLVER
Definition: ItemDefinitions.hpp:117
@ IT_WT_DOUBLE_DAGGERS
2 daggers
Definition: ItemDefinitions.hpp:126
@ IURMASK_ALL
Sum of all the above values.
Definition: ItemDefinitions.hpp:249
@ IURMASK_SITTING
Item can't be used while sitting.
Definition: ItemDefinitions.hpp:248
@ REFINE_CHANCE_TYPE_ENRICHED
Definition: ItemDefinitions.hpp:92
@ REFINE_CHANCE_TYPE_MAX
Definition: ItemDefinitions.hpp:95
@ REFINE_CHANCE_TYPE_E_NORMAL
Definition: ItemDefinitions.hpp:93
@ REFINE_CHANCE_TYPE_NORMAL
Definition: ItemDefinitions.hpp:91
@ REFINE_CHANCE_TYPE_E_ENRICHED
Definition: ItemDefinitions.hpp:94
@ IT_GENDER_FEMALE
Definition: ItemDefinitions.hpp:160
@ IT_GENDER_ANY
Definition: ItemDefinitions.hpp:162
@ IT_GENDER_MALE
Definition: ItemDefinitions.hpp:161
@ IT_LVL_WEAPON3
Definition: ItemDefinitions.hpp:153
@ IT_LVL_ARMOR
Definition: ItemDefinitions.hpp:150
@ IT_LVL_MAX
Definition: ItemDefinitions.hpp:155
@ IT_LVL_WEAPON2
Definition: ItemDefinitions.hpp:152
@ IT_LVL_WEAPON4
Definition: ItemDefinitions.hpp:154
@ IT_LVL_WEAPON1
Definition: ItemDefinitions.hpp:151

References IT_AT_ARROW, IT_AT_BULLET, IT_AT_CANNONBALL, IT_AT_DAGGER, IT_AT_GRENADE, IT_AT_KUNAI, IT_AT_MAX, IT_AT_NONE, IT_AT_SHELL, IT_AT_SHURIKEN, IT_AT_THROWABLE_ITEM, IT_BIND_ACCOUNT, IT_BIND_CHARACTER, IT_BIND_GUILD, IT_BIND_MAX, IT_BIND_NONE, IT_BIND_PARTY, IT_EQPI_ACC_L, IT_EQPI_ACC_R, IT_EQPI_AMMO, IT_EQPI_ARMOR, IT_EQPI_COSTUME_GARMENT, IT_EQPI_COSTUME_LOW, IT_EQPI_COSTUME_MID, IT_EQPI_COSTUME_TOP, IT_EQPI_GARMENT, IT_EQPI_HAND_L, IT_EQPI_HAND_R, IT_EQPI_HEAD_LOW, IT_EQPI_HEAD_MID, IT_EQPI_HEAD_TOP, IT_EQPI_MAX, IT_EQPI_SHADOW_ACC_L, IT_EQPI_SHADOW_ACC_R, IT_EQPI_SHADOW_ARMOR, IT_EQPI_SHADOW_SHIELD, IT_EQPI_SHADOW_SHOES, IT_EQPI_SHADOW_WEAPON, IT_EQPI_SHOES, IT_EQPM_ACC, IT_EQPM_ACC_L, IT_EQPM_ACC_R, IT_EQPM_AMMO, IT_EQPM_ARMOR, IT_EQPM_ARMS, IT_EQPM_COSTUME, IT_EQPM_COSTUME_GARMENT, IT_EQPM_COSTUME_HEAD_LOW, IT_EQPM_COSTUME_HEAD_MID, IT_EQPM_COSTUME_HEAD_TOP, IT_EQPM_GARMENT, IT_EQPM_HAND_L, IT_EQPM_HAND_R, IT_EQPM_HEAD_LOW, IT_EQPM_HEAD_MID, IT_EQPM_HEAD_TOP, IT_EQPM_HELM, IT_EQPM_NONE, IT_EQPM_SHADOW_ACC, IT_EQPM_SHADOW_ACC_L, IT_EQPM_SHADOW_ACC_R, IT_EQPM_SHADOW_ARMOR, IT_EQPM_SHADOW_ARMS, IT_EQPM_SHADOW_SHIELD, IT_EQPM_SHADOW_SHOES, IT_EQPM_SHADOW_WEAPON, IT_EQPM_SHIELD, IT_EQPM_SHOES, IT_EQPM_WEAPON, IT_GENDER_ANY, IT_GENDER_FEMALE, IT_GENDER_MALE, IT_LVL_ARMOR, IT_LVL_MAX, IT_LVL_WEAPON1, IT_LVL_WEAPON2, IT_LVL_WEAPON3, IT_LVL_WEAPON4, IT_TYPE_AMMO, IT_TYPE_ARMOR, IT_TYPE_CARD, IT_TYPE_CASH, IT_TYPE_CONSUMPTION_DELAY, IT_TYPE_ETC, IT_TYPE_HEALING, IT_TYPE_MAX, IT_TYPE_PET_ARMOR, IT_TYPE_PET_EGG, IT_TYPE_UNKNOWN, IT_TYPE_UNKNOWN2, IT_TYPE_USABLE, IT_TYPE_WEAPON, IT_WT_1HAXE, IT_WT_1HMACE, IT_WT_1HSPEAR, IT_WT_1HSWORD, IT_WT_2HAXE, IT_WT_2HMACE, IT_WT_2HSPEAR, IT_WT_2HSTAFF, IT_WT_2HSWORD, IT_WT_BOOK, IT_WT_BOW, IT_WT_DAGGER, IT_WT_DOUBLE_AXES, IT_WT_DOUBLE_DAGGER_AXE, IT_WT_DOUBLE_DAGGER_SWORD, IT_WT_DOUBLE_DAGGERS, IT_WT_DOUBLE_SWORD_AXE, IT_WT_DOUBLE_SWORDS, IT_WT_FIST, IT_WT_GATLING, IT_WT_GRENADE, IT_WT_HUUMA, IT_WT_KATAR, IT_WT_KNUCKLE, IT_WT_MUSICAL, IT_WT_REVOLVER, IT_WT_RIFLE, IT_WT_SHOTGUN, IT_WT_STAFF, IT_WT_WHIP, IT_WTM_MELEE, IT_WTM_RANGED, ITRMASK_ALL, ITRMASK_AUCTION, ITRMASK_BUYING_STORE, ITRMASK_CART, ITRMASK_DROP, ITRMASK_GSTORAGE, ITRMASK_MAIL, ITRMASK_NONE, ITRMASK_SELL_TO_NPC, ITRMASK_STORAGE, ITRMASK_TRADE, ITRMASK_TRADEWPARTNER, IURMASK_ALL, IURMASK_SITTING, REFINE_CHANCE_TYPE_E_ENRICHED, REFINE_CHANCE_TYPE_E_NORMAL, REFINE_CHANCE_TYPE_ENRICHED, REFINE_CHANCE_TYPE_MAX, REFINE_CHANCE_TYPE_NORMAL, REFINE_TYPE_ARMOR, REFINE_TYPE_MAX, REFINE_TYPE_WEAPON1, REFINE_TYPE_WEAPON2, REFINE_TYPE_WEAPON3, and REFINE_TYPE_WEAPON4.

◆ sync_functions()

void ItemComponent::sync_functions ( std::shared_ptr< sol::state >  state)
virtual

Implements Horizon::Zone::LUAComponent.

336{
337 state->set_function("get_item_info",
338 [] (uint32_t item_id) {
339 return ItemDB->get_item_by_id(item_id);
340 });
341}
#define ItemDB
Definition: ItemDB.hpp:119

References ItemDB.


The documentation for this class was generated from the following files: