diff options
author | Smokexyz <sagunkho@hotmail.com> | 2017-03-02 19:24:48 +0800 |
---|---|---|
committer | Smokexyz <sagunkho@hotmail.com> | 2017-04-04 13:38:16 +0800 |
commit | 974222a8d3f189083205bf5d330de04a43226ad3 (patch) | |
tree | b78280b9dad90616196ee37c3992c3e46962b906 /src/plugins/HPMHooking/HPMHooking.Defs.inc | |
parent | 20145c61053479b9acd8ed50c75a80c2a861e349 (diff) | |
download | hercules-974222a8d3f189083205bf5d330de04a43226ad3.tar.gz hercules-974222a8d3f189083205bf5d330de04a43226ad3.tar.bz2 hercules-974222a8d3f189083205bf5d330de04a43226ad3.tar.xz hercules-974222a8d3f189083205bf5d330de04a43226ad3.zip |
Implementation of Item Options System.
Allows the infusing of equipments with bonus item options.
This feature is constrained to clients of packet versions greater than or equal to `20150226`.
Item Options and their effects are defined server-side in `db/item_options.conf` and client side in `data/luafiles514/lua files/datainfo/addrandomoptionnametable.lub`
The ID of the option must tally with the correct index of the description provided in the client side lua file to avoid bugs.
IT_OPT_* keys and MAX_ITEM_OPTIONS macro are also exported from the source as constants.
An additional flag `disable_options` has been added to sql, and as `DisableOptions: true/false (boolean, defaults to false !!for equipments only!!)` to item_db.conf files.
Script commands documentation is also included.
SQL file updates are included.
Credits: [Smokexyz](https://github.com/Smokexyz)
Style and Script Fixes by [Asheraf](https://github.com/Asheraf)
Initial design Idea by [secretdataz](https://github.com/secretdataz)
Diffstat (limited to 'src/plugins/HPMHooking/HPMHooking.Defs.inc')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 57abf25e0..74af2f26d 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2222,8 +2222,8 @@ typedef void (*HPMHOOK_pre_clif_pNPCMarketClosed) (int *fd, struct map_session_d typedef void (*HPMHOOK_post_clif_pNPCMarketClosed) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pNPCMarketPurchase) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pNPCMarketPurchase) (int fd, struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_add_random_options) (unsigned char **buf, struct item **item); -typedef void (*HPMHOOK_post_clif_add_random_options) (unsigned char *buf, struct item *item); +typedef int (*HPMHOOK_pre_clif_add_random_options) (struct ItemOptions **buf, const struct item **it); +typedef int (*HPMHOOK_post_clif_add_random_options) (int retVal___, struct ItemOptions *buf, const struct item *it); typedef void (*HPMHOOK_pre_clif_pHotkeyRowShift) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pHotkeyRowShift) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_dressroom_open) (struct map_session_data **sd, int *view); @@ -3300,6 +3300,8 @@ typedef void (*HPMHOOK_pre_itemdb_read_chains) (void); typedef void (*HPMHOOK_post_itemdb_read_chains) (void); typedef void (*HPMHOOK_pre_itemdb_read_packages) (void); typedef void (*HPMHOOK_post_itemdb_read_packages) (void); +typedef void (*HPMHOOK_pre_itemdb_read_options) (void); +typedef void (*HPMHOOK_post_itemdb_read_options) (void); typedef void (*HPMHOOK_pre_itemdb_write_cached_packages) (const char **config_filename); typedef void (*HPMHOOK_post_itemdb_write_cached_packages) (const char *config_filename); typedef bool (*HPMHOOK_pre_itemdb_read_cached_packages) (const char **config_filename); @@ -3316,6 +3318,8 @@ typedef struct item_data* (*HPMHOOK_pre_itemdb_search) (int *nameid); typedef struct item_data* (*HPMHOOK_post_itemdb_search) (struct item_data* retVal___, int nameid); typedef struct item_data* (*HPMHOOK_pre_itemdb_exists) (int *nameid); typedef struct item_data* (*HPMHOOK_post_itemdb_exists) (struct item_data* retVal___, int nameid); +typedef struct item_option* (*HPMHOOK_pre_itemdb_option_exists) (int *idx); +typedef struct item_option* (*HPMHOOK_post_itemdb_option_exists) (struct item_option* retVal___, int idx); typedef bool (*HPMHOOK_pre_itemdb_in_group) (struct item_group **group, int *nameid); typedef bool (*HPMHOOK_post_itemdb_in_group) (bool retVal___, struct item_group *group, int nameid); typedef int (*HPMHOOK_pre_itemdb_group_item) (struct item_group **group); @@ -3380,6 +3384,8 @@ typedef int (*HPMHOOK_pre_itemdb_gendercheck) (struct item_data **id); typedef int (*HPMHOOK_post_itemdb_gendercheck) (int retVal___, struct item_data *id); typedef int (*HPMHOOK_pre_itemdb_validate_entry) (struct item_data **entry, int *n, const char **source); typedef int (*HPMHOOK_post_itemdb_validate_entry) (int retVal___, struct item_data *entry, int n, const char *source); +typedef void (*HPMHOOK_pre_itemdb_readdb_options_additional_fields) (struct item_option **ito, struct config_setting_t **t, int *n, const char **source); +typedef void (*HPMHOOK_post_itemdb_readdb_options_additional_fields) (struct item_option *ito, struct config_setting_t *t, int n, const char *source); typedef void (*HPMHOOK_pre_itemdb_readdb_additional_fields) (int *itemid, struct config_setting_t **it, int *n, const char **source); typedef void (*HPMHOOK_post_itemdb_readdb_additional_fields) (int itemid, struct config_setting_t *it, int n, const char *source); typedef void (*HPMHOOK_pre_itemdb_readdb_job_sub) (struct item_data **id, struct config_setting_t **t); @@ -3396,6 +3402,8 @@ typedef void (*HPMHOOK_pre_itemdb_destroy_item_data) (struct item_data **self, i typedef void (*HPMHOOK_post_itemdb_destroy_item_data) (struct item_data *self, int free_self); typedef int (*HPMHOOK_pre_itemdb_final_sub) (union DBKey *key, struct DBData **data, va_list ap); typedef int (*HPMHOOK_post_itemdb_final_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); +typedef int (*HPMHOOK_pre_itemdb_options_final_sub) (union DBKey *key, struct DBData **data, va_list ap); +typedef int (*HPMHOOK_post_itemdb_options_final_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef void (*HPMHOOK_pre_itemdb_clear) (bool *total); typedef void (*HPMHOOK_post_itemdb_clear) (bool total); typedef struct item_combo* (*HPMHOOK_pre_itemdb_id2combo) (unsigned short *id); |