summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc34
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc68
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc17
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc298
-rw-r--r--src/plugins/db2sql.c330
5 files changed, 686 insertions, 61 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 52c7bb0f6..f80dc9003 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -1320,12 +1320,18 @@ typedef void (*HPMHOOK_pre_clif_status_change) (struct block_list **bl, int *typ
typedef void (*HPMHOOK_post_clif_status_change) (struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3);
typedef void (*HPMHOOK_pre_clif_insert_card) (struct map_session_data **sd, int *idx_equip, int *idx_card, int *flag);
typedef void (*HPMHOOK_post_clif_insert_card) (struct map_session_data *sd, int idx_equip, int idx_card, int flag);
-typedef void (*HPMHOOK_pre_clif_inventorylist) (struct map_session_data **sd);
-typedef void (*HPMHOOK_post_clif_inventorylist) (struct map_session_data *sd);
-typedef void (*HPMHOOK_pre_clif_equiplist) (struct map_session_data **sd);
-typedef void (*HPMHOOK_post_clif_equiplist) (struct map_session_data *sd);
-typedef void (*HPMHOOK_pre_clif_cartlist) (struct map_session_data **sd);
-typedef void (*HPMHOOK_post_clif_cartlist) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_inventoryList) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_inventoryList) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_inventoryItems) (struct map_session_data **sd, enum inventory_type *type);
+typedef void (*HPMHOOK_post_clif_inventoryItems) (struct map_session_data *sd, enum inventory_type type);
+typedef void (*HPMHOOK_pre_clif_equipList) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_equipList) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_equipItems) (struct map_session_data **sd, enum inventory_type *type);
+typedef void (*HPMHOOK_post_clif_equipItems) (struct map_session_data *sd, enum inventory_type type);
+typedef void (*HPMHOOK_pre_clif_cartList) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_cartList) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_cartItems) (struct map_session_data **sd, enum inventory_type *type);
+typedef void (*HPMHOOK_post_clif_cartItems) (struct map_session_data *sd, enum inventory_type type);
typedef void (*HPMHOOK_pre_clif_favorite_item) (struct map_session_data **sd, unsigned short *index);
typedef void (*HPMHOOK_post_clif_favorite_item) (struct map_session_data *sd, unsigned short index);
typedef void (*HPMHOOK_pre_clif_clearcart) (int *fd);
@@ -1620,8 +1626,16 @@ typedef void (*HPMHOOK_pre_clif_openvendingAck) (int *fd, int *result);
typedef void (*HPMHOOK_post_clif_openvendingAck) (int fd, int result);
typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny);
typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny);
-typedef void (*HPMHOOK_pre_clif_storagelist) (struct map_session_data **sd, struct item **items, int *items_length);
-typedef void (*HPMHOOK_post_clif_storagelist) (struct map_session_data *sd, struct item *items, int items_length);
+typedef void (*HPMHOOK_pre_clif_storageList) (struct map_session_data **sd, struct item **items, int *items_length);
+typedef void (*HPMHOOK_post_clif_storageList) (struct map_session_data *sd, struct item *items, int items_length);
+typedef void (*HPMHOOK_pre_clif_guildStorageList) (struct map_session_data **sd, struct item **items, int *items_length);
+typedef void (*HPMHOOK_post_clif_guildStorageList) (struct map_session_data *sd, struct item *items, int items_length);
+typedef void (*HPMHOOK_pre_clif_storageItems) (struct map_session_data **sd, enum inventory_type *type, struct item **items, int *items_length);
+typedef void (*HPMHOOK_post_clif_storageItems) (struct map_session_data *sd, enum inventory_type type, struct item *items, int items_length);
+typedef void (*HPMHOOK_pre_clif_inventoryStart) (struct map_session_data **sd, enum inventory_type *type, const char **name);
+typedef void (*HPMHOOK_post_clif_inventoryStart) (struct map_session_data *sd, enum inventory_type type, const char *name);
+typedef void (*HPMHOOK_pre_clif_inventoryEnd) (struct map_session_data **sd, enum inventory_type *type);
+typedef void (*HPMHOOK_post_clif_inventoryEnd) (struct map_session_data *sd, enum inventory_type type);
typedef void (*HPMHOOK_pre_clif_updatestorageamount) (struct map_session_data **sd, int *amount, int *max_amount);
typedef void (*HPMHOOK_post_clif_updatestorageamount) (struct map_session_data *sd, int amount, int max_amount);
typedef void (*HPMHOOK_pre_clif_storageitemadded) (struct map_session_data **sd, struct item **i, int *index, int *amount);
@@ -2600,6 +2614,8 @@ typedef void (*HPMHOOK_pre_clif_petEvolutionResult) (int *fd, enum pet_evolution
typedef void (*HPMHOOK_post_clif_petEvolutionResult) (int fd, enum pet_evolution_result result);
typedef void (*HPMHOOK_pre_clif_party_dead_notification) (struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_party_dead_notification) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMemorialDungeonCommand) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMemorialDungeonCommand) (int fd, struct map_session_data *sd);
#endif // MAP_CLIF_H
#ifdef COMMON_CORE_H /* cmdline */
typedef void (*HPMHOOK_pre_cmdline_init) (void);
@@ -3126,6 +3142,8 @@ typedef bool (*HPMHOOK_pre_instance_valid) (int *instance_id);
typedef bool (*HPMHOOK_post_instance_valid) (bool retVal___, int instance_id);
typedef int (*HPMHOOK_pre_instance_destroy_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
typedef int (*HPMHOOK_post_instance_destroy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_instance_force_destroy) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_instance_force_destroy) (struct map_session_data *sd);
#endif // MAP_INSTANCE_H
#ifdef CHAR_INT_ACHIEVEMENT_H /* inter_achievement */
typedef int (*HPMHOOK_pre_inter_achievement_sql_init) (void);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 457bf90fe..8762975e1 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -912,12 +912,18 @@ struct {
struct HPMHookPoint *HP_clif_status_change_post;
struct HPMHookPoint *HP_clif_insert_card_pre;
struct HPMHookPoint *HP_clif_insert_card_post;
- struct HPMHookPoint *HP_clif_inventorylist_pre;
- struct HPMHookPoint *HP_clif_inventorylist_post;
- struct HPMHookPoint *HP_clif_equiplist_pre;
- struct HPMHookPoint *HP_clif_equiplist_post;
- struct HPMHookPoint *HP_clif_cartlist_pre;
- struct HPMHookPoint *HP_clif_cartlist_post;
+ struct HPMHookPoint *HP_clif_inventoryList_pre;
+ struct HPMHookPoint *HP_clif_inventoryList_post;
+ struct HPMHookPoint *HP_clif_inventoryItems_pre;
+ struct HPMHookPoint *HP_clif_inventoryItems_post;
+ struct HPMHookPoint *HP_clif_equipList_pre;
+ struct HPMHookPoint *HP_clif_equipList_post;
+ struct HPMHookPoint *HP_clif_equipItems_pre;
+ struct HPMHookPoint *HP_clif_equipItems_post;
+ struct HPMHookPoint *HP_clif_cartList_pre;
+ struct HPMHookPoint *HP_clif_cartList_post;
+ struct HPMHookPoint *HP_clif_cartItems_pre;
+ struct HPMHookPoint *HP_clif_cartItems_post;
struct HPMHookPoint *HP_clif_favorite_item_pre;
struct HPMHookPoint *HP_clif_favorite_item_post;
struct HPMHookPoint *HP_clif_clearcart_pre;
@@ -1212,8 +1218,16 @@ struct {
struct HPMHookPoint *HP_clif_openvendingAck_post;
struct HPMHookPoint *HP_clif_vendingreport_pre;
struct HPMHookPoint *HP_clif_vendingreport_post;
- struct HPMHookPoint *HP_clif_storagelist_pre;
- struct HPMHookPoint *HP_clif_storagelist_post;
+ struct HPMHookPoint *HP_clif_storageList_pre;
+ struct HPMHookPoint *HP_clif_storageList_post;
+ struct HPMHookPoint *HP_clif_guildStorageList_pre;
+ struct HPMHookPoint *HP_clif_guildStorageList_post;
+ struct HPMHookPoint *HP_clif_storageItems_pre;
+ struct HPMHookPoint *HP_clif_storageItems_post;
+ struct HPMHookPoint *HP_clif_inventoryStart_pre;
+ struct HPMHookPoint *HP_clif_inventoryStart_post;
+ struct HPMHookPoint *HP_clif_inventoryEnd_pre;
+ struct HPMHookPoint *HP_clif_inventoryEnd_post;
struct HPMHookPoint *HP_clif_updatestorageamount_pre;
struct HPMHookPoint *HP_clif_updatestorageamount_post;
struct HPMHookPoint *HP_clif_storageitemadded_pre;
@@ -2192,6 +2206,8 @@ struct {
struct HPMHookPoint *HP_clif_petEvolutionResult_post;
struct HPMHookPoint *HP_clif_party_dead_notification_pre;
struct HPMHookPoint *HP_clif_party_dead_notification_post;
+ struct HPMHookPoint *HP_clif_pMemorialDungeonCommand_pre;
+ struct HPMHookPoint *HP_clif_pMemorialDungeonCommand_post;
struct HPMHookPoint *HP_cmdline_init_pre;
struct HPMHookPoint *HP_cmdline_init_post;
struct HPMHookPoint *HP_cmdline_final_pre;
@@ -2686,6 +2702,8 @@ struct {
struct HPMHookPoint *HP_instance_valid_post;
struct HPMHookPoint *HP_instance_destroy_timer_pre;
struct HPMHookPoint *HP_instance_destroy_timer_post;
+ struct HPMHookPoint *HP_instance_force_destroy_pre;
+ struct HPMHookPoint *HP_instance_force_destroy_post;
struct HPMHookPoint *HP_intif_parse_pre;
struct HPMHookPoint *HP_intif_parse_post;
struct HPMHookPoint *HP_intif_create_pet_pre;
@@ -7477,12 +7495,18 @@ struct {
int HP_clif_status_change_post;
int HP_clif_insert_card_pre;
int HP_clif_insert_card_post;
- int HP_clif_inventorylist_pre;
- int HP_clif_inventorylist_post;
- int HP_clif_equiplist_pre;
- int HP_clif_equiplist_post;
- int HP_clif_cartlist_pre;
- int HP_clif_cartlist_post;
+ int HP_clif_inventoryList_pre;
+ int HP_clif_inventoryList_post;
+ int HP_clif_inventoryItems_pre;
+ int HP_clif_inventoryItems_post;
+ int HP_clif_equipList_pre;
+ int HP_clif_equipList_post;
+ int HP_clif_equipItems_pre;
+ int HP_clif_equipItems_post;
+ int HP_clif_cartList_pre;
+ int HP_clif_cartList_post;
+ int HP_clif_cartItems_pre;
+ int HP_clif_cartItems_post;
int HP_clif_favorite_item_pre;
int HP_clif_favorite_item_post;
int HP_clif_clearcart_pre;
@@ -7777,8 +7801,16 @@ struct {
int HP_clif_openvendingAck_post;
int HP_clif_vendingreport_pre;
int HP_clif_vendingreport_post;
- int HP_clif_storagelist_pre;
- int HP_clif_storagelist_post;
+ int HP_clif_storageList_pre;
+ int HP_clif_storageList_post;
+ int HP_clif_guildStorageList_pre;
+ int HP_clif_guildStorageList_post;
+ int HP_clif_storageItems_pre;
+ int HP_clif_storageItems_post;
+ int HP_clif_inventoryStart_pre;
+ int HP_clif_inventoryStart_post;
+ int HP_clif_inventoryEnd_pre;
+ int HP_clif_inventoryEnd_post;
int HP_clif_updatestorageamount_pre;
int HP_clif_updatestorageamount_post;
int HP_clif_storageitemadded_pre;
@@ -8757,6 +8789,8 @@ struct {
int HP_clif_petEvolutionResult_post;
int HP_clif_party_dead_notification_pre;
int HP_clif_party_dead_notification_post;
+ int HP_clif_pMemorialDungeonCommand_pre;
+ int HP_clif_pMemorialDungeonCommand_post;
int HP_cmdline_init_pre;
int HP_cmdline_init_post;
int HP_cmdline_final_pre;
@@ -9251,6 +9285,8 @@ struct {
int HP_instance_valid_post;
int HP_instance_destroy_timer_pre;
int HP_instance_destroy_timer_post;
+ int HP_instance_force_destroy_pre;
+ int HP_instance_force_destroy_post;
int HP_intif_parse_pre;
int HP_intif_parse_post;
int HP_intif_create_pet_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 41e6f9208..2f3f1840f 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -480,9 +480,12 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->combo_delay, HP_clif_combo_delay) },
{ HP_POP(clif->status_change, HP_clif_status_change) },
{ HP_POP(clif->insert_card, HP_clif_insert_card) },
- { HP_POP(clif->inventorylist, HP_clif_inventorylist) },
- { HP_POP(clif->equiplist, HP_clif_equiplist) },
- { HP_POP(clif->cartlist, HP_clif_cartlist) },
+ { HP_POP(clif->inventoryList, HP_clif_inventoryList) },
+ { HP_POP(clif->inventoryItems, HP_clif_inventoryItems) },
+ { HP_POP(clif->equipList, HP_clif_equipList) },
+ { HP_POP(clif->equipItems, HP_clif_equipItems) },
+ { HP_POP(clif->cartList, HP_clif_cartList) },
+ { HP_POP(clif->cartItems, HP_clif_cartItems) },
{ HP_POP(clif->favorite_item, HP_clif_favorite_item) },
{ HP_POP(clif->clearcart, HP_clif_clearcart) },
{ HP_POP(clif->item_identify_list, HP_clif_item_identify_list) },
@@ -630,7 +633,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->openvending, HP_clif_openvending) },
{ HP_POP(clif->openvendingAck, HP_clif_openvendingAck) },
{ HP_POP(clif->vendingreport, HP_clif_vendingreport) },
- { HP_POP(clif->storagelist, HP_clif_storagelist) },
+ { HP_POP(clif->storageList, HP_clif_storageList) },
+ { HP_POP(clif->guildStorageList, HP_clif_guildStorageList) },
+ { HP_POP(clif->storageItems, HP_clif_storageItems) },
+ { HP_POP(clif->inventoryStart, HP_clif_inventoryStart) },
+ { HP_POP(clif->inventoryEnd, HP_clif_inventoryEnd) },
{ HP_POP(clif->updatestorageamount, HP_clif_updatestorageamount) },
{ HP_POP(clif->storageitemadded, HP_clif_storageitemadded) },
{ HP_POP(clif->storageitemremoved, HP_clif_storageitemremoved) },
@@ -1120,6 +1127,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->pPetEvolution, HP_clif_pPetEvolution) },
{ HP_POP(clif->petEvolutionResult, HP_clif_petEvolutionResult) },
{ HP_POP(clif->party_dead_notification, HP_clif_party_dead_notification) },
+ { HP_POP(clif->pMemorialDungeonCommand, HP_clif_pMemorialDungeonCommand) },
/* cmdline_interface */
{ HP_POP(cmdline->init, HP_cmdline_init) },
{ HP_POP(cmdline->final, HP_cmdline_final) },
@@ -1379,6 +1387,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(instance->set_timeout, HP_instance_set_timeout) },
{ HP_POP(instance->valid, HP_instance_valid) },
{ HP_POP(instance->destroy_timer, HP_instance_destroy_timer) },
+ { HP_POP(instance->force_destroy, HP_instance_force_destroy) },
/* intif_interface */
{ HP_POP(intif->parse, HP_intif_parse) },
{ HP_POP(intif->create_pet, HP_intif_create_pet) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 5690e0735..860e47f1b 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -11890,13 +11890,13 @@ void HP_clif_insert_card(struct map_session_data *sd, int idx_equip, int idx_car
}
return;
}
-void HP_clif_inventorylist(struct map_session_data *sd) {
+void HP_clif_inventoryList(struct map_session_data *sd) {
int hIndex = 0;
- if (HPMHooks.count.HP_clif_inventorylist_pre > 0) {
+ if (HPMHooks.count.HP_clif_inventoryList_pre > 0) {
void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventorylist_pre; hIndex++) {
- preHookFunc = HPMHooks.list.HP_clif_inventorylist_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryList_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_inventoryList_pre[hIndex].func;
preHookFunc(&sd);
}
if (*HPMforce_return) {
@@ -11905,24 +11905,50 @@ void HP_clif_inventorylist(struct map_session_data *sd) {
}
}
{
- HPMHooks.source.clif.inventorylist(sd);
+ HPMHooks.source.clif.inventoryList(sd);
}
- if (HPMHooks.count.HP_clif_inventorylist_post > 0) {
+ if (HPMHooks.count.HP_clif_inventoryList_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventorylist_post; hIndex++) {
- postHookFunc = HPMHooks.list.HP_clif_inventorylist_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryList_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_inventoryList_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-void HP_clif_equiplist(struct map_session_data *sd) {
+void HP_clif_inventoryItems(struct map_session_data *sd, enum inventory_type type) {
int hIndex = 0;
- if (HPMHooks.count.HP_clif_equiplist_pre > 0) {
+ if (HPMHooks.count.HP_clif_inventoryItems_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryItems_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_inventoryItems_pre[hIndex].func;
+ preHookFunc(&sd, &type);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.inventoryItems(sd, type);
+ }
+ if (HPMHooks.count.HP_clif_inventoryItems_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryItems_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_inventoryItems_post[hIndex].func;
+ postHookFunc(sd, type);
+ }
+ }
+ return;
+}
+void HP_clif_equipList(struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_equipList_pre > 0) {
void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiplist_pre; hIndex++) {
- preHookFunc = HPMHooks.list.HP_clif_equiplist_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipList_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_equipList_pre[hIndex].func;
preHookFunc(&sd);
}
if (*HPMforce_return) {
@@ -11931,24 +11957,50 @@ void HP_clif_equiplist(struct map_session_data *sd) {
}
}
{
- HPMHooks.source.clif.equiplist(sd);
+ HPMHooks.source.clif.equipList(sd);
}
- if (HPMHooks.count.HP_clif_equiplist_post > 0) {
+ if (HPMHooks.count.HP_clif_equipList_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiplist_post; hIndex++) {
- postHookFunc = HPMHooks.list.HP_clif_equiplist_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipList_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_equipList_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-void HP_clif_cartlist(struct map_session_data *sd) {
+void HP_clif_equipItems(struct map_session_data *sd, enum inventory_type type) {
int hIndex = 0;
- if (HPMHooks.count.HP_clif_cartlist_pre > 0) {
+ if (HPMHooks.count.HP_clif_equipItems_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipItems_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_equipItems_pre[hIndex].func;
+ preHookFunc(&sd, &type);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.equipItems(sd, type);
+ }
+ if (HPMHooks.count.HP_clif_equipItems_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipItems_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_equipItems_post[hIndex].func;
+ postHookFunc(sd, type);
+ }
+ }
+ return;
+}
+void HP_clif_cartList(struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_cartList_pre > 0) {
void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartlist_pre; hIndex++) {
- preHookFunc = HPMHooks.list.HP_clif_cartlist_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartList_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_cartList_pre[hIndex].func;
preHookFunc(&sd);
}
if (*HPMforce_return) {
@@ -11957,17 +12009,43 @@ void HP_clif_cartlist(struct map_session_data *sd) {
}
}
{
- HPMHooks.source.clif.cartlist(sd);
+ HPMHooks.source.clif.cartList(sd);
}
- if (HPMHooks.count.HP_clif_cartlist_post > 0) {
+ if (HPMHooks.count.HP_clif_cartList_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartlist_post; hIndex++) {
- postHookFunc = HPMHooks.list.HP_clif_cartlist_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartList_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_cartList_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
+void HP_clif_cartItems(struct map_session_data *sd, enum inventory_type type) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_cartItems_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartItems_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_cartItems_pre[hIndex].func;
+ preHookFunc(&sd, &type);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.cartItems(sd, type);
+ }
+ if (HPMHooks.count.HP_clif_cartItems_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartItems_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_cartItems_post[hIndex].func;
+ postHookFunc(sd, type);
+ }
+ }
+ return;
+}
void HP_clif_favorite_item(struct map_session_data *sd, unsigned short index) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_favorite_item_pre > 0) {
@@ -15809,13 +15887,39 @@ void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount, u
}
return;
}
-void HP_clif_storagelist(struct map_session_data *sd, struct item *items, int items_length) {
+void HP_clif_storageList(struct map_session_data *sd, struct item *items, int items_length) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_storageList_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item **items, int *items_length);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageList_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_storageList_pre[hIndex].func;
+ preHookFunc(&sd, &items, &items_length);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.storageList(sd, items, items_length);
+ }
+ if (HPMHooks.count.HP_clif_storageList_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct item *items, int items_length);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageList_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_storageList_post[hIndex].func;
+ postHookFunc(sd, items, items_length);
+ }
+ }
+ return;
+}
+void HP_clif_guildStorageList(struct map_session_data *sd, struct item *items, int items_length) {
int hIndex = 0;
- if (HPMHooks.count.HP_clif_storagelist_pre > 0) {
+ if (HPMHooks.count.HP_clif_guildStorageList_pre > 0) {
void (*preHookFunc) (struct map_session_data **sd, struct item **items, int *items_length);
*HPMforce_return = false;
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storagelist_pre; hIndex++) {
- preHookFunc = HPMHooks.list.HP_clif_storagelist_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guildStorageList_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_guildStorageList_pre[hIndex].func;
preHookFunc(&sd, &items, &items_length);
}
if (*HPMforce_return) {
@@ -15824,17 +15928,95 @@ void HP_clif_storagelist(struct map_session_data *sd, struct item *items, int it
}
}
{
- HPMHooks.source.clif.storagelist(sd, items, items_length);
+ HPMHooks.source.clif.guildStorageList(sd, items, items_length);
}
- if (HPMHooks.count.HP_clif_storagelist_post > 0) {
+ if (HPMHooks.count.HP_clif_guildStorageList_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct item *items, int items_length);
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storagelist_post; hIndex++) {
- postHookFunc = HPMHooks.list.HP_clif_storagelist_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guildStorageList_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_guildStorageList_post[hIndex].func;
postHookFunc(sd, items, items_length);
}
}
return;
}
+void HP_clif_storageItems(struct map_session_data *sd, enum inventory_type type, struct item *items, int items_length) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_storageItems_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type, struct item **items, int *items_length);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageItems_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_storageItems_pre[hIndex].func;
+ preHookFunc(&sd, &type, &items, &items_length);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.storageItems(sd, type, items, items_length);
+ }
+ if (HPMHooks.count.HP_clif_storageItems_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type, struct item *items, int items_length);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageItems_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_storageItems_post[hIndex].func;
+ postHookFunc(sd, type, items, items_length);
+ }
+ }
+ return;
+}
+void HP_clif_inventoryStart(struct map_session_data *sd, enum inventory_type type, const char *name) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_inventoryStart_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type, const char **name);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryStart_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_inventoryStart_pre[hIndex].func;
+ preHookFunc(&sd, &type, &name);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.inventoryStart(sd, type, name);
+ }
+ if (HPMHooks.count.HP_clif_inventoryStart_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryStart_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_inventoryStart_post[hIndex].func;
+ postHookFunc(sd, type, name);
+ }
+ }
+ return;
+}
+void HP_clif_inventoryEnd(struct map_session_data *sd, enum inventory_type type) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_inventoryEnd_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryEnd_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_inventoryEnd_pre[hIndex].func;
+ preHookFunc(&sd, &type);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.inventoryEnd(sd, type);
+ }
+ if (HPMHooks.count.HP_clif_inventoryEnd_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryEnd_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_inventoryEnd_post[hIndex].func;
+ postHookFunc(sd, type);
+ }
+ }
+ return;
+}
void HP_clif_updatestorageamount(struct map_session_data *sd, int amount, int max_amount) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_updatestorageamount_pre > 0) {
@@ -28574,6 +28756,32 @@ void HP_clif_party_dead_notification(struct map_session_data *sd) {
}
return;
}
+void HP_clif_pMemorialDungeonCommand(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_pMemorialDungeonCommand_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMemorialDungeonCommand_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_pMemorialDungeonCommand_pre[hIndex].func;
+ preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pMemorialDungeonCommand(fd, sd);
+ }
+ if (HPMHooks.count.HP_clif_pMemorialDungeonCommand_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMemorialDungeonCommand_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_pMemorialDungeonCommand_post[hIndex].func;
+ postHookFunc(fd, sd);
+ }
+ }
+ return;
+}
/* cmdline_interface */
void HP_cmdline_init(void) {
int hIndex = 0;
@@ -35268,6 +35476,32 @@ int HP_instance_destroy_timer(int tid, int64 tick, int id, intptr_t data) {
}
return retVal___;
}
+void HP_instance_force_destroy(struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_instance_force_destroy_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_force_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_instance_force_destroy_pre[hIndex].func;
+ preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.instance.force_destroy(sd);
+ }
+ if (HPMHooks.count.HP_instance_force_destroy_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_force_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_instance_force_destroy_post[hIndex].func;
+ postHookFunc(sd);
+ }
+ }
+ return;
+}
/* intif_interface */
int HP_intif_parse(int fd) {
int hIndex = 0;
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c
index 57e68432e..2ece501b2 100644
--- a/src/plugins/db2sql.c
+++ b/src/plugins/db2sql.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2015 Hercules Dev Team
+ * Copyright (C) 2013-2018 Hercules Dev Team
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -70,6 +70,10 @@ bool mobdb2sql_torun = false;
int (*itemdb_readdb_libconfig_sub) (struct config_setting_t *it, int n, const char *source);
/// Backup of the original mob_db parser function pointer.
int (*mob_read_db_sub) (struct config_setting_t *it, int n, const char *source);
+bool (*mob_skill_db_libconfig_sub_skill) (struct config_setting_t *it, int n, int mob_id);
+
+//
+void do_mobskilldb2sql(void);
/**
* Normalizes and appends a string to the output buffer.
@@ -811,6 +815,330 @@ void do_mobdb2sql(void)
if (tosql.buf[i].p)
aFree(tosql.buf[i].p);
}
+
+ // Run mob_skill_db converter
+ do_mobskilldb2sql();
+}
+
+/**
+ * Converts Mob Skill State constant to string
+ */
+const char* mob_skill_state_tostring(enum MobSkillState mss)
+{
+ switch(mss) {
+ case MSS_ANY:
+ return "any";
+ case MSS_IDLE:
+ return "idle";
+ case MSS_WALK:
+ return "walk";
+ case MSS_LOOT:
+ return "loot";
+ case MSS_DEAD:
+ return "dead";
+ case MSS_BERSERK:
+ return "attack";
+ case MSS_ANGRY:
+ return "angry";
+ case MSS_RUSH:
+ return "chase";
+ case MSS_FOLLOW:
+ return "follow";
+ case MSS_ANYTARGET:
+ return "anytarget";
+ }
+
+ return "unknown";
+}
+
+/**
+ * Converts Mob Skill Target constant to string
+ */
+const char* mob_skill_target_tostring(int target)
+{
+ switch(target) {
+ case MST_TARGET:
+ return "target";
+ case MST_RANDOM:
+ return "randomtarget";
+ case MST_SELF:
+ return "self";
+ case MST_FRIEND:
+ return "friend";
+ case MST_MASTER:
+ return "master";
+ case MST_AROUND1:
+ return "around1";
+ case MST_AROUND2:
+ return "around2";
+ case MST_AROUND3:
+ return "around3";
+ //case MST_AROUND: // same value as MST_AROUND4
+ case MST_AROUND4:
+ return "around4";
+ case MST_AROUND5:
+ return "around5";
+ case MST_AROUND6:
+ return "around6";
+ case MST_AROUND7:
+ return "around7";
+ case MST_AROUND8:
+ return "around8";
+ }
+ return "unknown";
+}
+
+/**
+ * Converts Mob Skill Condition constant to string
+ */
+const char* mob_skill_condition_tostring(int condition)
+{
+ switch(condition) {
+ case MSC_ALWAYS:
+ return "always";
+ case MSC_MYHPLTMAXRATE:
+ return "myhpltmaxrate";
+ case MSC_MYHPINRATE:
+ return "myhpinrate";
+ case MSC_FRIENDHPLTMAXRATE:
+ return "friendhpltmaxrate";
+ case MSC_FRIENDHPINRATE:
+ return "friendhpinrate";
+ case MSC_MYSTATUSON:
+ return "mystatuson";
+ case MSC_MYSTATUSOFF:
+ return "mystatusoff";
+ case MSC_FRIENDSTATUSON:
+ return "friendstatuson";
+ case MSC_FRIENDSTATUSOFF:
+ return "friendstatusoff";
+ case MSC_ATTACKPCGT:
+ return "attackpcgt";
+ case MSC_ATTACKPCGE:
+ return "attackpcge";
+ case MSC_SLAVELT:
+ return "slavelt";
+ case MSC_SLAVELE:
+ return "slavele";
+ case MSC_CLOSEDATTACKED:
+ return "closedattacked";
+ case MSC_LONGRANGEATTACKED:
+ return "longrangeattacked";
+ case MSC_AFTERSKILL:
+ return "afterskill";
+ case MSC_SKILLUSED:
+ return "skillused";
+ case MSC_CASTTARGETED:
+ return "casttargeted";
+ case MSC_RUDEATTACKED:
+ return "rudeattacked";
+ case MSC_MASTERHPLTMAXRATE:
+ return "masterhpltmaxrate";
+ case MSC_MASTERATTACKED:
+ return "masterattacked";
+ case MSC_ALCHEMIST:
+ return "alchemist";
+ case MSC_SPAWN:
+ return "onspawn";
+ }
+ return "unknown";
+}
+
+/**
+ * Converts a Mob Skill DB entry to SQL.
+ *
+ * @see mob_skill_db_libconfig_sub_skill.
+ */
+bool mobskilldb2sql_sub(struct config_setting_t *it, int n, int mob_id)
+{
+ int i32 = 0, i;
+ StringBuf buf;
+ struct mob_db *md = mob->db(mob_id);
+ char valname[15];
+ const char *name = config_setting_name(it);
+
+ nullpo_retr(false, it);
+ Assert_retr(false, mob_id <= 0 || md != mob->dummy);
+
+ StrBuf->Init(&buf);
+
+ // MonsterID
+ StrBuf->Printf(&buf, "%d,", mob_id);
+
+ // Info
+ StrBuf->Printf(&buf, "'%s@%s',", md->name, name);
+
+ if (mob->lookup_const(it, "SkillState", &i32) && (i32 < MSS_ANY || i32 > MSS_ANYTARGET)) {
+ ShowWarning("mob_skill_db_libconfig_sub_skill: Invalid skill state %d for skill '%s' in monster %d, defaulting to MSS_ANY.\n", i32, name, mob_id);
+ i32 = MSS_ANY;
+ }
+ // State
+ StrBuf->Printf(&buf, "'%s',", mob_skill_state_tostring(i32));
+
+ // SkillID
+ if (!(i32 = skill->name2id(name))) {
+ ShowWarning("mob_skill_db_libconfig_sub_skill: Non existant skill id %d in monster %d, skipping.\n", i32, mob_id);
+ return false;
+ }
+ StrBuf->Printf(&buf, "%d,", i32);
+
+ // SkillLv
+ if (!libconfig->setting_lookup_int(it, "SkillLevel", &i32) || i32 <= 0)
+ i32 = 1;
+ StrBuf->Printf(&buf, "%d,", i32);
+
+ // Rate
+ i32 = 0;
+ libconfig->setting_lookup_int(it, "Rate", &i32);
+ StrBuf->Printf(&buf, "%d,", i32);
+
+ // CastTime
+ i32 = 0;
+ libconfig->setting_lookup_int(it, "CastTime", &i32);
+ StrBuf->Printf(&buf, "%d,", i32);
+
+ // Delay
+ i32 = 0;
+ libconfig->setting_lookup_int(it, "Delay", &i32);
+ StrBuf->Printf(&buf, "%d,", i32);
+
+ // Cancelable
+ if (libconfig->setting_lookup_bool(it, "Cancelable", &i32)) {
+ StrBuf->Printf(&buf, "'%s',", ((i32 == 0) ? "no" : "yes"));
+ } else {
+ StrBuf->Printf(&buf, "'no',");
+ }
+
+ // Target
+ if (mob->lookup_const(it, "SkillTarget", &i32) && (i32 < MST_TARGET || i32 > MST_AROUND)) {
+ i32 = MST_TARGET;
+ }
+ StrBuf->Printf(&buf, "'%s',", mob_skill_target_tostring(i32));
+
+ // Condition
+ if (mob->lookup_const(it, "CastCondition", &i32) && (i32 < MSC_ALWAYS || i32 > MSC_SPAWN)) {
+ i32 = MSC_ALWAYS;
+ }
+ StrBuf->Printf(&buf, "'%s',", mob_skill_condition_tostring(i32));
+
+ // ConditionValue
+ i32 = 0;
+ if (mob->lookup_const(it, "ConditionData", &i32)) {
+ StrBuf->Printf(&buf, "'%d',", i32);
+ } else {
+ StrBuf->Printf(&buf, "NULL,");
+ }
+
+ // Val1-Val5
+ for (i = 0; i < 5; i++) {
+ sprintf(valname, "val%1d", i);
+ if (libconfig->setting_lookup_int(it, valname, &i32)) {
+ StrBuf->Printf(&buf, "%d,", i32);
+ } else {
+ StrBuf->Printf(&buf, "NULL,");
+ }
+ }
+
+ // Emotion
+ if (libconfig->setting_lookup_int(it, "Emotion", &i32)) {
+ StrBuf->Printf(&buf, "'%d',", i32);
+ } else {
+ StrBuf->Printf(&buf, "NULL,");
+ }
+
+ if (libconfig->setting_lookup_int(it, "ChatMsgID", &i32) && i32 > 0 && i32 <= MAX_MOB_CHAT) {
+ StrBuf->Printf(&buf, "'%d'", i32);
+ } else {
+ StrBuf->Printf(&buf, "NULL");
+ }
+
+ fprintf(tosql.fp, "REPLACE INTO `%s` VALUES (%s);\n", tosql.db_name, StrBuf->Value(&buf));
+
+ StrBuf->Destroy(&buf);
+
+ return true;
+
+}
+
+
+/**
+ * Prints a SQL table header for the current mob_skill_db table.
+ */
+void mobskilldb2sql_tableheader(void)
+{
+ db2sql_fileheader();
+
+ fprintf(tosql.fp,
+ "--\n"
+ "-- Table structure for table `%s`\n"
+ "--\n"
+ "\n"
+ "DROP TABLE IF EXISTS `%s`;\n"
+ "CREATE TABLE `%s` (\n"
+ " `MOB_ID` SMALLINT(6) NOT NULL,\n"
+ " `INFO` TEXT NOT NULL,\n"
+ " `STATE` TEXT NOT NULL,\n"
+ " `SKILL_ID` SMALLINT(6) NOT NULL,\n"
+ " `SKILL_LV` TINYINT(4) NOT NULL,\n"
+ " `RATE` SMALLINT(4) NOT NULL,\n"
+ " `CASTTIME` MEDIUMINT(9) NOT NULL,\n"
+ " `DELAY` INT(9) NOT NULL,\n"
+ " `CANCELABLE` TEXT NOT NULL,\n"
+ " `TARGET` TEXT NOT NULL,\n"
+ " `CONDITION` TEXT NOT NULL,\n"
+ " `CONDITION_VALUE` TEXT,\n"
+ " `VAL1` INT(11) DEFAULT NULL,\n"
+ " `VAL2` INT(11) DEFAULT NULL,\n"
+ " `VAL3` INT(11) DEFAULT NULL,\n"
+ " `VAL4` INT(11) DEFAULT NULL,\n"
+ " `VAL5` INT(11) DEFAULT NULL,\n"
+ " `EMOTION` TEXT,\n"
+ " `CHAT` TEXT\n"
+ ") ENGINE=MyISAM;\n"
+ "\n", tosql.db_name, tosql.db_name, tosql.db_name);
+}
+
+/**
+ * Mob Skill DB Conversion
+ */
+void do_mobskilldb2sql(void)
+{
+ int i;
+ struct convert_db_files {
+ const char *name;
+ const char *source;
+ const char *destination;
+ } files[] = {
+ {"mob_skill_db", DBPATH"mob_skill_db.conf", "sql-files/mob_skill_db" DBSUFFIX ".sql"},
+ {"mob_skill_db2", "mob_skill_db2.conf", "sql-files/mob_skill_db2.sql"},
+ };
+
+ /* link */
+ mob_skill_db_libconfig_sub_skill = mob->skill_db_libconfig_sub_skill;
+ mob->skill_db_libconfig_sub_skill = mobskilldb2sql_sub;
+
+ memset(&tosql.buf, 0, sizeof(tosql.buf));
+ for (i = 0; i < ARRAYLENGTH(files); i++) {
+ if ((tosql.fp = fopen(files[i].destination, "wt+")) == NULL) {
+ ShowError("do_mobskilldb2sql: File not found \"%s\".\n", files[i].destination);
+ return;
+ }
+
+ tosql.db_name = files[i].name;
+ mobskilldb2sql_tableheader();
+
+ mob->skill_db_libconfig(files[i].source, false);
+
+ fclose(tosql.fp);
+ }
+
+ /* unlink */
+ mob->skill_db_libconfig_sub_skill = mob_skill_db_libconfig_sub_skill;
+
+ for (i = 0; i < ARRAYLENGTH(tosql.buf); i++) {
+ if (tosql.buf[i].p)
+ aFree(tosql.buf[i].p);
+ }
}
/**